[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);
上一篇:HDU #5733 tetrahedron


下一篇:Symfony2 HttpKernel事件驱动