https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/find
find() 方法返回数组中满足提供的测试函数的第一个元素的值。如果找不到,返回 undefined。
示例:
const array1 = [1, 3, 5, 7, 9]
// 找到结果,为7
const findResult1 = array1.find(x => x > 5)
// 找不到结果,返回undefined
const findResult2 = array1.find(x => x > 100)
console.log('findResult1 = ' + findResult1)
console.log('findResult2 = ' + findResult2)
输出: