js在数组中查找是否存在某一个数值

目前想到的方法有这么几个html 1.indexOf()  -> ES5app const array = ['apple', 'banance', 'orange']post array.indexOf('apple')    // 0 存在spa array.indexOf('strawBerry')      // -1不存在   2.find()   -> ES6 const array
相关文章
相关标签/搜索