var b = "Holaa Holaa Holaa Holaa ";
console.log(b);
How can I remove all Holaa matches except the first?
Exactly I mean the whole chain itself, taking into account this example:
String.prototype.repetir = function(v) {
return v < 1 ? '' : new Array(v+1).join(this);
};
var b = "hola pepe !".repetir(4);
console.log(b);
Basically, how to do the recursive form of the repeat function, eliminating all the coincidences of the whole sentence, not just words, but as if we did not know that there is that repeat function.