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.
The problem is you're using
for...in
, read this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in and in the tests, the array prototype is modified.You, and the kata's author/translator used a
solution
var without declaring it (with var or let), that's the problem. I've fixed it in the testing part, I suggest you do that also in your code as good practice.This comment is hidden because it contains spoiler information about the solution
Can't reproduce it, was it in javascript? Post your code as stated here: https://docs.codewars.com/training/troubleshooting#post-discourse
I have an issue that seems related to the tests and not my code. I get this error if i return the correct string in attempt:
It should work for random tests too - Expected: ['Marge,', 'Barney,', 'Moe,', 'Lisa', '& Ned'], instead got: 'Marge, Barney, Moe, Lisa & Ned'
If I return the array instead of a string, all the random tests pass, but then i fail the basic tests which correctly ask for a string in return, am I missing something or it is just maybe a newly introduced bug with the tests?