What exactly is the issue with using the regexp?
-
-
-
It’s explained in the write-up. (Spoiler: you have to remember to escape special RegExp chars + to use the g flag.)
- 7 more replies
New conversation -
-
-
Yay!! All these v8 features are supported using babel or directly using latest chrome version?
-
See https://v8.dev/features/string-replaceall#support … — for now, you’ll have to use Babel/polyfills. But the functionality is coming to browsers soon! Both
@SpiderMonkeyJS and@v8js already have flagged implementations.
End of conversation
New conversation -
-
-
But this only work on browser! The replace method with regex works in node too.
-
What makes you say that? Once a version of
@v8js supporting replaceAll rolls into Node.js, it will work there as well, like any other language feature.
End of conversation
New conversation -
-
-
Oh hey, you created the WebKit bug report. Anyway, it’s not linked in that article. ¯\_(ツ)_/¯
-
Feel free to submit a PR that adds the link! I didn’t because there has been no real activity on the bug yet.
End of conversation
New conversation -
-
-
"constant"
-
What are you referring to?
End of conversation
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.
The new String.prototype.replaceAll API is here to help!