天天看點

關于ES6的replaceAll()簡化replace一次性替換所有子字元串

// 以前
console.log('aaa'.replace(/a/g,'A')) //AAA

// 簡化後
console.log('aaa'.replaceAll('a','A')) //AAA