Closed cschuff closed 7 years ago
Allows for the special strings of String.prototype.replace to occur in code. This is achieved by passing a function (which will not touch those special strings) instead of passing a plain string into String.prototype.replace
see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter
👍 interesting quirk of string.replace . Never saw that before haha. Thanks for the contribution!
Me neither :D You never stop learning :)
Thanks for the fast response!
Allows for the special strings of String.prototype.replace to occur in code. This is achieved by passing a function (which will not touch those special strings) instead of passing a plain string into String.prototype.replace
see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter