This string method exists in browserland, but not in Node. Why not? It's neither brand-new nor exotic.
- replaceAll is part of ECMA-262 src
- replaceAll is described in detail on the V8 blog (added in v8.1) src
- NodeJS upgraded to V8 v8.1 with NodeJS v14.0 src
And yet:
$ node
Welcome to Node.js v14.13.1.
Type ".help" for more information.
> 'asdf'.replaceAll
undefined
I'm not asking for polyfills; I can do a regex or loop over single-instance replace. I'm trying to figure out why this seemingly unremarkable feature doesn't exist in NodeJS, even though it seems to be available in just about every other JS environment, and even though all the docs suggest to me that it should exist.