文档页面: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll
let string = ":insertx: :insertx: :inserty: :inserty: :insertz: :insertz:";
let newstring = string.replaceAll(":insertx:", 'hello!');
当我运行这个命令时,我收到 Uncaught TypeError: string.replaceAll is not a function。也许我误解了什么是原型,但函数似乎是一个可用的字符串方法。
我在用 Chrome。