str="every dog\n has its days,Dog work like a dog";var reg=/dog/;str2=str.replace(reg,"man") = (1) 。console.log(str.replace(/dog/i,"man")) =(2)。console.log(str.replace(/dog/g,"man")) =(3) 。console.log(str.replace(/dog/ig,"man")) = (4) 。console.log(str.replace(/dog$/m,"man")) = (5) 。console.log(str.replace(/dog$/,"man")) = (6) 。console.log(str.replace(/dog$/g,"man")) = (7) 。
var arr = ['html','javascript',1995]下面每一个空都与上面的填空无关!!arr.length :。arr.reverse():。arr.join(‘-->’):。arr.sort(): 。arr.concat([‘BOM’,‘DOM‘]): 。