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.
This comment is hidden because it contains spoiler information about the solution
Exactly!
ok, I got it.
+d //converting a string to number
|| 0 //if there was no number inside that string, it gives us 0, instead of NaN.
Can you please explain why do we use AND here and what is happening in this part? Thank you!
n &&
upd: found a solution, so here if n is falsey we just return false before executing the second part.
This comment is hidden because it contains spoiler information about the solution
Maybe because you didn't use the initial value.
This comment is hidden because it contains spoiler information about the solution
Sounds like you used 52 characters...
thanks a lot! It doesn't allow me switch the flag now :(
That's dangerous. If you skip it and the array has a length of one, you'll try to add the first element with undefined. So it's better practices to add it anyway (only case where you can forget it is when you're absolutely sure there are at least 2 elements.
What you cannot skip, tho: the spoiler flag. ;p
This comment is hidden because it contains spoiler information about the solution
I have got an error - 9 characters is too long.
But the description says that the maximum length is 43 chars.
Thanks! That's the best answer!