摘要: 1、如果数组所有元素都满足函数条件,则返回true。调用时,如果省略第二个参数,则默认传递布尔值。 const all= (arr, fn=Boolean) => arr.every(fn); console.log(all([0,1,1])); //false console.log(all([1 阅读全文
posted @ 2020-07-08 13:46 jmwlhj 阅读(234) 评论(0) 推荐(0) 编辑