查找元素

数组和集合 / 数组

let numbers = [2, 3, 5, 7, 11, 13, 17]
let index5 = numbers.indexOf(5)
//index5 is 2

let contain10 = numbers.indexOf(10) > -1
//contain10 is false

console.log(`index5 is ${index5}`)
console.log(`contain10 is ${contain10}`)