js中replace is not a function问题解决 2022-04-27 本文已影响0人 c6e71129966d 原因:replace() 是string类型才有的方法。 解决方案:先用typeof 判断是否是string类型再继续进行下一步