replaceAll is not a function 问题解决
文章目录
在chrome 浏览器中使用 replaceAll 报 这个错误, 是因为chrome 版本过低, 在chrome 85 以上版本才支持
1.查看chrome 浏览器版本
2.查看replaceAll 支持的浏览器
3.解决办法:使用replace 代替
"abab".replace(/[a]/g, "") //结果 bb
"waabbxaabby".replace(/(aabb)/g, "") //wxy在chrome 浏览器中使用 replaceAll 报 这个错误, 是因为chrome 版本过低, 在chrome 85 以上版本才支持
1.查看chrome 浏览器版本
2.查看replaceAll 支持的浏览器
3.解决办法:使用replace 代替
"abab".replace(/[a]/g, "") //结果 bb
"waabbxaabby".replace(/(aabb)/g, "") //wxy
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论