Ad
  • Default User Avatar

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

  • Custom User Avatar

    I am not completely sure why there are curly brackets and plys inside but i know rest. So this regex will try with match method to match all odd OR even numbers from num(which will be always num because here we passed if/else with ternary operator) and then match is returning array of matched elements, so at the end he is passing join() method with '-' as with what to join them.