Ad
  • Custom User Avatar

    Sorry, my bad. Figured it out. Cheers.

  • Custom User Avatar
    expected [ 'Mn', 'Wc', 'kU', 'Xp', 'yw', 'fx', 'Uf', 'qp', 'F_', 'FH', 'vX', 'DU', 'Py', 'HI', 'DT', 'jO' ] // This is your wrong answer
    to deeply equal [ 'Mn', 'Wc', 'kU', 'Xp', 'yw', 'fx', 'Uf', 'qp', 'FM', 'FH', 'vX', 'DU', 'Py', 'HI', 'DT', 'jO' ] // This is the right answer
    

    That's a problem with your code. Print the input and debug it. Or add this test to sample tests and see your code fail:

    assert.deepEqual(solution("abba"), ["ab", "ba"]);
    

    There is no problem with the tests:

    JavaScript Completions 36104

  • Custom User Avatar

    When I press "Test", it returns "You have passed all of the tests! :)".

    However, when I press "Attempt", it returns an error in Random tests.

    Take a close look at the expected results of any random test:

    expected

    [ 'Mn', 'Wc', 'kU', 'Xp', 'yw', 'fx', 'Uf', 'qp', 'F_', 'FH', 'vX', 'DU', 'Py', 'HI', 'DT', 'jO' ]

    to deeply equal

    [ 'Mn', 'Wc', 'kU', 'Xp', 'yw', 'fx', 'Uf', 'qp', 'FM', 'FH', 'vX', 'DU', 'Py', 'HI', 'DT', 'jO' ]

    If you say there's no problem in random tests, how come 'F_' is supposed to equal 'FM'?!

  • Custom User Avatar

    No, there is no problem in random tests in javascript. That's your code's problem, read this: https://docs.codewars.com/training/troubleshooting/

  • Custom User Avatar

    If your regex doesn't match anything, it returns null, and you then try to use .map on it (so you get this error).

  • Custom User Avatar

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

  • Custom User Avatar

    There seems to be a mistake in random tests when you hit "Attempt"