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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Pretty interesting.
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.
Yes, later i saw that, thank you for your answer.
This comment is hidden because it contains spoiler information about the solution