Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I think it's more like 6kyu
(JS) Push and unshift methods do not work when toLowerCase used in any part of code. In browser console code work fine
Undefined is valid only when it's "" in test - empty string has no length. So I add check on string.length with break to quit code execution: switch (str.length) { case 0: return false break} ABOVE toUpperCase method line, so it had to be irrelevant wether toUpperCase were used in code in lower lines or not.
Why have testing keep throw an toUpperCase error when I quit code execution before toUpperCase method has been applied?
I keep rewrite my code over and over again. I do not use touppercase, (though, why?), I keep have right answers in my browser console, and I keep have errors when trying to test it. Different errors. First version apparently didn't like touppercase using, ok, I changed it. Second version didn't like an replace method (not sure but still, it was adviced in discussion), I changed it too. Third version didn't like an one word case test - expected false to equal '#CodeWars'. But I do have '#CodeWars' as a result in browser console! I also do not check string.length too early, and still, errors.
The test for this cata is written POORLY and BUGGY! Why does it reject touppercase method and keep throw an error? It also reject fromCharCode(charCodeAt) method and also keep throw an error.
What. Is. Wrong. With. This. Cata???
If your test code do have problems with certain methods, then may be you'd mention it in cata conditions not to use this and that?
Ok, but why? Isn't it an cata testing problem if it keep throw error when you solve a task with method that is different from what author expected you'l be using?
Wow, new method, thanks!
Author have to specify that you required to solve this cata with filter method, not mention it. He have to point out that other solve variations wouldn't pass tests.
If you try to solve it with reg exp, you have to keep in mind .match method return either non empty array of matches or null. So you need to not just match (think for other methods for null check)
This comment is hidden because it contains spoiler information about the solution
Can someone decode what 0 <= x <= 4 is mean?
An author?
This comment is hidden because it contains spoiler information about the solution
Thank you friend, your advice help me alot and save me lot of time on last part of training.
Yeah. Specifically pointing to always keep first element is so much confusing and took me extra time to solve it, thugh first elem would naturally be saved hadn't be there special pointing to "always keep" first element.
Absolutely!
Loading more items...