使用indexOf() 方法可返回某个指定的字符串值,在字符串中首次出现,的位置。如果要检索的字符串值没有出现,则该方法返回 -1。
var str = "123"; console.log(str.indexOf("3") != -1 ); // true
好的希望帮助大家,拜拜!