Ad
  • Custom User Avatar

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

  • Default User Avatar

    Yes, I thought they were locked because the test cases were locked. They also use test.expect. But, should it be consistent and use Test.expect or some other function

  • Custom User Avatar

    Well, while sample tests are indeed not obligatory, lack of them is often considered a kata problem, isn't it?

  • Default User Avatar

    Not an issue. 11,000+ people completed in javascript. Press attempt.

  • Custom User Avatar

    Sorry for the late reply. So the empty string before I put the line number tells java that this is String addition. In this case, I am not sure it is necessary beacause I am adding another String right after. Also, I made this a long time ago, so this is not good coding practice at all. String addition is generally bad practice because it takes up extra memory (Strings are immutable).

    Just to answer your question more clearly:

    (5) is an int

    ("" + 5) is a String

    For clarity, String.valueOf(5) is probably better.