DEV Community

Discussion on: ES 2021 Features

Collapse
 
pepkin88 profile image
Marek Pepke

Although there is also another way, which is available today, but it may not be obvious for everyone.
It is the split/join technique:
text.split(replaceThat).join(withThat)