Ad
  • Default User Avatar

    Even better would be to put the string in an array and print that array:

    console.log([string])
    

    That way you are shown things like \r\n\t without ambiguity

  • Default User Avatar

    Welp. Okay. I wasn't going to submit with your code because... well it's your code, and I haven't solved it yet >.>

    I ran it anyhow. I see it now.
    How do I phrase this .. Yes, this is confusing test output. Though, they're correctly judging your result. The output is off because ... because codewars uses imperfect encoding of data between the tests, the servers and our browsers and because of that there can be ambiguities or mixups. You are logging, it isn't shown.

  • Custom User Avatar

    Replace console.log(string) with console.log("Input value: '" + string + "'")

    There is nothing wrong with the tests.

  • Default User Avatar

    BTW. Next time you ask about something odd, make sure that you are up-fronting enough information to reproduce what you're seeing. Otherwise you are the host of a guessing game, and you probably aren't getting any answers that you want as a result of not having provided enough information to produce those answers.

    For example, you showed your solution code... which is good, but not sufficient. Pressing reset and entering your code, followed by running the sample tests does not produce the output you're describing. So effectively it isn't happening and you can't really ask about something that isn't happening.

    Of course, we could trust you on what you're saying, but that doesn't ... really work at all. First of all, why would we? You might know yourself to be trustworthy, nobody else does. And then there's going to be information lost in communication, and furthermore you're probably not making the required observations or you'd have figured it all out. But when you show how to reproduce it, you get rid of all those very difficult problems.

  • Default User Avatar

    The original sample tests have four assertions, you show five. That makes the fifth assertion likely to be something you added. And presumably the reason why there is no log is because nothing was logged.

  • Default User Avatar

    Those are separate tests. Note that you get one verdict per assertion.

  • Custom User Avatar

    Your code is failing the next test.