Categoria: cheatsheet,javascript

JavaScript cheasheet

Add replaceAll function to existing String object 1234String.prototype.replaceAll = function(search, replacement) { var target = this; return target.replace(new RegExp(search, 'g'), replace