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 -
-
-
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. - 2 more replies
New conversation -
-
-
Feel free to submit a PR that adds the link! I didn’t because there has been no real activity on the bug yet.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
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 -
-
-
Both
@v8js and@SpiderMonkeyJS have implementations, and we can certainly create fast paths for the case where replaceAll is called with two string arguments (and more!). https://cs.chromium.org/chromium/src/v8/src/builtins/string-replaceall.tq?l=108-109&rcl=5a2bf4dc93b903eb71336802c03b5d2f9668495d … -
I had no doubts. Contrary to some other people, I know my stuff my bit and can think beyond "OMG they add a useless method"... This quite illustrate the field.
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!