indexOf (元素值)寻找字符是否存在数组中 2018-07-10 本文已影响0人 司马皮砸瓜 var arr=[10,20,30,40,50]; var box=arr.indexOf(300); console.log(box); //存在就显示当前的索引位置,不存在会返回-1