JS replaceAll 步骤实现

JS replaceAll 方法实现String.prototype.replaceAll function(s1,s2){return this.replace(new RegExp(s

JS replaceAll 方法实现
String.prototype.replaceAll  = function(s1,s2){  
    return this.replace(new RegExp(s1,"gm"),s2);  
}