检查数组元素中是否有元素符合指定。

// 数组中的元素部分满足指定条件返回true
let arr = [1, 3, 5, 7, 9];
console.log(arr.some((value, index, array) => value > 10));// false
console.log(arr.some((value, index, array) => value > 8));// true

 

相关文章:

  • 2021-07-05
  • 2021-10-10
  • 2022-01-08
  • 2021-11-24
  • 2022-12-23
  • 2022-03-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-28
  • 2022-12-23
  • 2021-06-19
  • 2021-06-08
  • 2021-06-22
  • 2021-05-31
  • 2021-10-03
相关资源
相似解决方案