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.This comment is hidden because it contains spoiler information about the solution
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.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?
No idea without seeing your code, read this: https://docs.codewars.com/training/troubleshooting#post-discourse
Test Results:
Test Passed: Value == 'Bart, Lisa, Maggie, Homer & Marge'
Test Passed: Value == 'Bart, Lisa & Maggie'
Test Passed: Value == 'Bart & Lisa'
Test Passed: Value == 'Bart'
Test Passed: Value == ''
However when I attempt:
Must work with many names - Expected: 'Bart, Lisa, Maggie, Homer & Marge', instead got: 'Bart, Lisa, Maggie, Homer & Marge, '
Must work with many names - Expected: 'Bart, Lisa & Maggie', instead got: 'Bart, Lisa & Maggie, '
Must work with two names - Expected: 'Bart & Lisa', instead got: 'Bart & Lisa, '
Wrong output for a single name - Expected: 'Bart', instead got: 'Bart, '
Must work with no names - Expected: '', instead got: ', '
How did the tests work but 0/45 additional tests not work (especially ones that are the same)? When I run in code editor I get back the correct results I received in the test cases.