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.
Your reply is 6 months old, so I assume you figured it out, but for those reading and wondering the same.
||[] this part of the code, if no match was found, it returns an empty array and if you call .length on an empty array, it will return 0
How did you do that bruh in a single line!
No, it will return 0.
What if you pass an empty string? it will return error
This comment is hidden because it contains spoiler information about the solution
Use spoiler flag next time, your post was visible in the homepage.
This comment is hidden because it contains spoiler information about the solution
superb one liner!
And i thought that regexp work slow, isn't it?
This comment is hidden because it contains spoiler information about the solution
clever one!
Thank you so much for your concise and thorough explanation! I'm incredibly new to JavaScript and programming in general so all of this is new to me but I appreciate the time (and characters) you took to explain this concept.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
smart code!!
Loading more items...