Ad
  • Custom User Avatar

    Thank you for the feedback! I agree, this wasn't the intended solution. I initially allowed it because it still managed to complete the objective, but in retrospect I should have just added these tests from the start. I've updated the Kata with the test cases =)

  • Custom User Avatar

    Well, that would mean that every time the function is called, those values are re-created. Doesn't matter so much for primitives like strings, but object like the regex will have to be put in new memory every time, and get garbage collected every time. It's probably a bit padantic, but that how I think of it, anyway.