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.
When data input is the following:
Test assertion is the following:
I get this test rejection...
Expected: '[[\'politician\', 1], [\'scientific\', 3], [\'teacher\', 3]]', instead got: '[[\'teacher\', 3], [\'scientific\', 3], [\'politician\', 1]]'
I don't know what to do :/
Yeah, but... not in the spirit of the exercise, or that doesn't matter?
some()
returns a boolean,forEach()
does not return a value. Areturn
can be added as a seccond line.Array.prototype.each = [].some;
How about that.
I definitely suggest you make this an iterative process instead of a recursive process. The recursive process will deplete the stack very quickly due to the way the number of steps and memory consumption increases with the number. This might be a shorter (code wise) recursive solution but if you use recursion with an iterative process it will ensure that the stack is never depleted.