I am still getting used to Javascript (I'm coming from C++) and would like to add a new function to String which mutates the string instance directly. Let's say that I want to add a new character at the midpoint of the string (ignoring any error checking). In C++ you could do something like this->value = ...
. Is that the way to do this in Javascript? TIA
String.prototype.mutateSelf = function(param1) {
// How do I mutate this specific string instance?
return this;
};