JavaScript gains first-class support for global substring replacement!
@mathias explains the new String.prototype.replaceAll API: https://v8.dev/features/string-replaceall …
(V8 v8.0 has an experimental implementation behind the --harmony-string-replaceall flag.)
-
-
FYI, I have course curriculum (videos, code) out there in the wild that uses a non-global regex with matchAll()... so unfortunately that stuff "breaks" with the change. But... shrugs.
-
Any chance of updating some of those resources?
- 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.