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.
Thanks Balkoth, my mistake!
Guess I should report this problem even though it really doesn't affect anything else.
On the kata page, I selected the following options:
The problem is the list of kata I get from that includes a few dozen kata that I have already completed.
Well, technically, ["Bob"] and ["Bob"] are two different objects, so they're not equal.
To compare arrays or objects, you should use Test.assertSimilar instead of Test.assertEquals.
The testing framework seems to be buggy - go to Kata http://www.codewars.com/kata/5356ad2cbb858025d800111d/train/javascript
With my solution, I get the following error:
Expected: ["Bob"], instead got: ["Bob"]
...obviously, these are the same, so it should have passed! Below is my solution and test data (spoiler alert):
Solution:
function capMe(names) {
var capitalised = [], newName;
for (var i = 0; i<names.length; i++) {
newName = names[i].toLowerCase();
newName = newName.charAt(0).toUpperCase() + newName.slice(1);
capitalised.push(newName);
}
return capitalised;
}
TEST CASES:
var test = ['bob'];
Test.assertEquals(capMe(test), ['Bob']);
test = ['bob', 'james', 'CHRIS'];
Test.assertEquals(capMe(test), ['Bob', 'James', 'Chris']);