[ES6] Array.find()

Convenient method to find one item in an array, avoid writing and  for + if:

let arys = [1,,5,,6] ;
let target = 6;
let res = arys.find(item => item === target);
console.log(res);
原文地址:https://www.cnblogs.com/Answer1215/p/4957852.html