Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Simple, remove the spaces from the string, then return the resultant string.

    Your function's code has no return inside so your function is returning undefined.
    console.log can be used to debug, but for almost all katas in Codewars, your function should return a value.
    If you're completely new to programming I suggest you try doing some free online course/s first because although there are beginner katas here, most assume you have a certain knowledge and won't explain the very basics.

  • Custom User Avatar

    Not a kata issue, it's a problem with your code, use Question label for cases like this.
    Don't use global vars (they keep their values between tests), and your function should return a string, don't write code outside your function, it won't run when your function is called.