why the flip is there both String.prototype.replace and String.prototype.replaceAll in JavaScript

Nov 12, 2022, 7:07 AM
0 0 6

comments (single view)

i checked, it’s for things like this where you’re not sure about what you’re replacing

String.prototype.removeAll = function (remove) {
  return this.replaceAll(remove, "")
}

why should that matter

Try doing it without replaceAll

View all comments