关于javascript中indexOf()小记

var s = 123;

s.indexOf(2);

对数字类型的数据使用此方法会报错,s.indexOf is not a function

indexOf(),只能应用于字符串类型的数据

猜你喜欢

转载自blog.csdn.net/drugonwo/article/details/80911315