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.
Deep clone is simple: what if some elements in your array are objects? Obviously you should copy them too, or else if you make changes to this objects, it'll be reflected on the one in the other array too.
And what if some elements of that object is, again, objects? The rabbit hole is deep here, and you need deep clone to clone all of them ;-)
No, that's still the same object. Look for built-in array methods to get a copy of an array ;-)
You made changes to the input array. Because it's an object the changes will persist even outside your function ;-)
The simplest fix at your end is to copy the array (deep copy, but for this kata just a shallow copy is enough). It's both discouraged for writing code that mutates the input, and writing code that'll break if input is mutated ;-)
Looks like mutating the input is causing problems again.
I'll resolve this issue since it's not clear about the actual issue, and re-raise a clear one. Meanwhile, don't mutate the input ;-)