-
-
Save Lukas238/0eb2a729a75470a61202a3926374d9d6 to your computer and use it in GitHub Desktop.
Using regex to replace match strings with auto increment number.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'An aplle is not a banana'.replace(/a/g, (() => { | |
var number = 0; | |
return () => { | |
return number++; | |
} | |
})()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment