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.
My solution passes those. But fails one in the final run. (the first one)
Not an issue
This comment is hidden because it contains spoiler information about the solution
Here are the ones I wrote if they help:
const sqr = once((x) => { return x * x})
Test.assertEquals(sqr(3), 9)
Test.assertEquals(sqr(5), undefined)
const add = once((a,b) => { return a + b })
Test.assertEquals(add(1,2), 3)
Test.assertEquals(add(5,9), undefined)
Test.assertNotEquals(add(1,2), 3)
Yep. Your function returns undefined and the tests pass it as the argument to your function again.
Using push on undefined causes the error.
Why have you commented out the return statement? Your function should return the array after appending to it.
If you have [].reduce(fn) instead of [].reduce(fn,0) with empty arr you will get that error.
Maybe if you post your code, we can provide some more helpful comments. As it stands, I'm not sure what you mean.