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.
Mixing up the two arguments is not funny.
Array [0,1,2]
Param 0
Expected: '[0, 1, 2]', instead got: '[0, 1, 2, 0]'
Is this correct?
I passed the other tests except this one.
Instructions aren't very clear. Also, sometimes param and arr seem to be mixed up (e.g. param is an array instead of arr). If this is expected, it would be helpful if were spelled out in the instructions. Otherwise, this was a good kata.
This kata is not just about fixing broken code. The instructions ought to refer to fixing broken input, as well. When an input parameter called arr is passed to the function, but there's a chance that it might not actually be an array, then the instructions should provide some warning of this.
Oh, that's okay, and you're most welcome.
Changing inputs is a common pitfall. It should be guarded and tested against.
I completely misunderstood your comment about change of input parameter (e.g. mutating the input array), and really appreciate your new test for it!
Well, you did, and you did not.
I took the liberty of adding the second test. Does that look like it makes sense?
Also, added a couple of example tests from the submit tests, and changed the first test mentioned above to make it discriminate against wrong order of evaluating params being arrays.
Take a look here section 4.6.
If you need more help just ask.
Can you give me an example of what you mean?
done and done
Needs static tests for
([1,2],[1,2]) => [1,2,[1,2]] and not [1,2,1,2]
, and for change of input parameter.You should consider to add random test.