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.
Please read the last bullet point in this paragraph of FAQ.
You have a misplaced
)
there, it's:Well: If you call
match
with a Regexp on a string and there are no matches, it returnsnull
.It's not that, it's
.match(/foo/) || []
. Did you miss a parenthase?I don't understand it either. People are suggesting that [] is returned in place of null. but:
[] is also a truthy value, not falsy:
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
if there's no match, you don't get an empty array, but you do get a falsy value.