📜  替换函数 javascript 循环 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:44.997000             🧑  作者: Mango

代码示例1
let str = 'JS will, JS will rock you!';
let newStr = str.replace(/JS/g,'JavaScript');

console.log(newStr);
Code language: JavaScript (javascript)
//output :JavaScript will, JavaScript will rock you!