前端基础Javascript数据类型基本类型Array方法[every()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/every)On this pageevery()Try itevery() 方法测试一个数组内的所有元素是否都能通过某个指定函数的测试。它返回一个布尔值。const isBelowThreshold = (currentValue) => currentValue < 40;const array1 = [1, 30, 39, 29, 10, 13];console.log(array1.every(isBelowThreshold));// expected output: true语法返回值如果回调函数的每一次返回都为 truthy 值,返回 true,否则返回 false。