Ad
  • Default User Avatar

    No, you were not, and that's unnecessarily strong language. If you must reflect with self-deprecation, let's say you were a no0b, just like any other beginner. And if as a beginner you passed the kata, great. And if as a beginner, you learned from others' code how to improve, GREAT, you got better. On principle I have upvoted your original comment, and welcome others to do the same to rectify this travesty of punishing what appears to me to be a beginner for asking a fair question.

  • Default User Avatar

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

  • Default User Avatar

    JavaScript is pretty much designed to give you some salvageable output in as many cases as possible rather than exceptions or errors. Unless you do something really wrong (like calling a method that doesn't exist), you can usually assume something like undefined, null or NaN will be returned, and/or that the language will silently handle edge cases for you (like slicing an array past its end). This answer happens to be a case where both things are happening.

  • Default User Avatar

    Lol, looking back on it now, I see that it's too much work.

  • Default User Avatar

    Also, may I ask: where in this code is anything turned into a string?

  • Default User Avatar

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