Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
m is the part of a string that's matched with regexp provided, the callback replaces this part with incremented value. For instance if there is 'somestring0' it returns ++0(1) and if it's 'somestring499' ++499(500) is returned. Then it replaces regexp in the way as joekotvas explained above
So elegant. Love this!
Lovely solution.
I don't get how the RegEx works… 😅 I checked on RegExr but it actually didn't match the test examples there and the description didn't really help. Baby step walk through would be much appreciated! 🙃
Still cant understand what the m parameter recieves as an argument. Could you please elaborate
String()
can be removed.to convert a string into a number