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.)
- Još 7 drugih odgovora
Novi razgovor -
-
-
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.
Kraj razgovora
Novi razgovor -
-
-
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.
Kraj razgovora
Novi razgovor -
-
-
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.
Kraj razgovora
Novi razgovor -
-
-
"constant"
-
What are you referring to?
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.
The new String.prototype.replaceAll API is here to help!