Ad
  • Custom User Avatar

    you need to test by passing something more complex to the function besides ABC. songDecoder("AWUBWUBWUBBWUBWUBWUBC"); This will help you understand why you're getting errors.

  • Custom User Avatar

    That's because without the join, it fails the first test, and with it, it fails the second.

    WUB should be replaced by 1 space: expected [ 'A', 'B', 'C' ] to equal 'A B C'           // error message without join
    multiples WUB should be replaced by only 1 space: expected 'A  B C' to equal 'A B C'     // with it
    

    The only error is in your code:

    JavaScript Completions 24695

    You can try changing Node version to 8 to see all the logs (no matter if your code fails), 10 onwards it stops when it fails one test and the next ones aren't executed.

  • Custom User Avatar

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

  • Custom User Avatar

    There is no issue with the kata, your code is wrong.

    JavaScript Completions 24686

    And it'll fail with inputs like "AWUBAWUBA" too. Use console.log to evaluate middle values or something like Pythontutor

  • Custom User Avatar

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

  • Custom User Avatar

    I'm having an issue with the Javascript version of this challenge. On my local IDE, using the same language version and same test inputs, the test for the first case returns the correct anser of "A B C", however, when performing the same task on the kata, the function returns "A B C". This is especially odd considering that utilizing the .join() method with '/' instead of ' ' returns the correct answer with backslashes instead of spaces ("A/B/C"), but as soon as it is switched back to .join(' '), the test returns "A B C". This seems to be an issue with the kata. I will reply with my solution as a spoiler.

  • Custom User Avatar

    that's what makes it so powerful. you can still go off and write your own methods/solutions to problems you encounter much like you would in java, but if you happen to know little tricks like these it can make the whole process much easier.