Ad
  • Default User Avatar
  • Custom User Avatar

    REGEXP should be a RegExp object, currently you have a String.

  • Custom User Avatar

    If the string already ends with a number, the number should be incremented by 1.

    If the string does not end with a number. the number 1 should be appended to the new string.

    What would you do with foo1bar? Removing all numbers from the string and moving them at the end is a wrong interpretation of the instructions.

  • Custom User Avatar

    Read the description again, where does it say it should increment every number in the string? Also, what's the logic in your answer, you're moving the numbers to the end of the strings, aren't you?
    I agree an example in the kata's description would clarify it.