简单类型 / 字符串

let startString = "3, 2, 1, go!";
startString = startString
    .replace("1""one")
    .replace("2""two")
    .replace("3""three");
//startString = "three, two, one, go!"
console.log(startString);

//replace all
let oneString = "1 1 1";
oneString = oneString
    .replace(new RegExp("1""g"), "one");
//oneString is "one one one"
console.log(oneString);