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.
This comment is hidden because it contains spoiler information about the solution
My code doesn't pass test 4, 7, 8, 9, 11, 12, 13, 14. The first error is: "Expected: Leonard, instead got: Penny". This seem to happen due to the names array input stacking up all the names as a global variable. I then tried to declare a copy of it to a new variable, and refer to that copy while running my function. Same problem persist. Finally - I made a raw copy of the names array and put it in my code. It now passes all the tests, but instead I'm getting an error saying "Process was terminated. It took longer than 6000ms to complete". Can someone please help me explain what's going on?
I'm using JavaScript.
Thanks in advance!