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.
Wow so blind this morning :D NVM me then :D
It's already there.
This comment is hidden because it contains spoiler information about the solution
"Call a built-in" is a worthless kata idea.
you gotta be more clear in your instructions
You probably right. But how I should react there is a lot of unresolved issues.
Being simple is not an issue. The kata is just targeted towards beginners.
I remember a user getting stuck at a similar kata because he reassigned a variable instead of using mutating functions.
It's easy to forget what it is like to be a beginner.
too simple
Yep. Your function returns undefined and the tests pass it as the argument to your function again.
Using push on undefined causes the error.
I've passed the kata. Just trying to understand the guts of the call stack.
This is the line that causes the error:
addWord(addWord(list, 'how are you'), 'goodbye');
So I'm guessing that because the nested call to addWord hasn't returned 'goodbye' cannot be appended.
Why have you commented out the return statement? Your function should return the array after appending to it.
This comment is hidden because it contains spoiler information about the solution
Not so
Random test cases needed.
addWord(array, string){
array.push(string)
array=this.array
}
gives
Test Passed: Value == ["hello"]
TypeError: Cannot call method 'push' of undefined
at addWord
Loading more items...