Here you can find the source of delete()
String.prototype.delete=function() { for(var e in arguments) { console.log(typeof arguments[e]); this.replace(arguments[e],''); console.log(this);// ww w. ja va 2 s .c o m } return this.valueOf(); } console.log("Hello World123".delete(/h/gi, /[0-9]/g));
String.prototype.delete = function () { var str = this.toString(); for(let i = 0; i < arguments.length; i++) { switch(typeof arguments[i]) { case 'string': str = str.replace(new RegExp(arguments[i], 'g'), ""); break; case 'object': str = str.replace(arguments[i], ""); ...
String.prototype.delete = function(remove) { var result= ''; for(var i=0;i<this.length;i++) { for (var j=0;j<remove.length;j++) { if(this.charAt(i) != remove.charAt(j)) { result += this.charAt(i) return result console.log("Hello World".delete('o'))