How would you expect a String.prototype.replaceAll(searchValue, replaceValue) function to behave? Should it accept RegExps? Should replaceValue support substitution syntax and callable replacers?
-
-
Would it take a start index, a maximum number of replacements, etc.? I see the use case but it sounds like the type of thing that led to PHP's gazillion str functions.
-
No, just search and replace arguments. See the linked proposal above. My personal preference here is 'as simple as possible'. How would you avoid PHPs situation?
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.