Ad
  • Custom User Avatar

    "Call a built-in" is a worthless kata idea.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Random test cases needed.

  • Default User Avatar

    addWord(array, string){
    array.push(string)
    array=this.array
    }
    gives
    Test Passed: Value == ["hello"]
    TypeError: Cannot call method 'push' of undefined
    at addWord

  • Custom User Avatar

    Tests are not testing the rights things in the right time and mislead to wrong assumption.

    It is not clarrified that function must return the modified list. It is not clarified that the function should modify the list given as parameter.

    It could be interesting to have a quick discussion on parameters passed by reference and by value in JS.

    It could be more natural to add a function to the array prototype instead of creating a function.

  • Default User Avatar

    Point out it should return the list

  • Custom User Avatar

    You should use a proper value for list in the example:

    var list =  []
    addWord(list, "hello") // list is now ["hello"]
    addWord(list, "world") // list is now ["hello","world"]