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.
That's clever! I like this solution.
lol, that is actually the only unit test I used, and my answer is 2. I think both opinion makes sense.
This works depending on the parameters of the problem:
Should the following function return 1 or 2?
solution('bbb','bb')
It's performance varies with browser, FF 25 for instance is faster at regex on my laptop (split is 32% slower than regex), Chrome 30 is 64% slower for regex than join (and chrome regex performs over 200,000 ops less than FF in the test time)
The exception breaks the forEach when the item is found.
This comment is hidden because it contains spoiler information about the solution