摘要:
let arr2 =[1,3,5,7,9,10]; //arr2.every() 数组里面所有的元素都有符合条件,才返回true var b =arr2.every(function (val,index,arr) { return val<=10 }) console.log(b) 效果图: 阅读全文
摘要:
let arr =[ {title:'aaaa',read:100,hot:true}, {title:'bbbb',read:50,hot:false}, {title:'ccc',read:100,hot:true} ]; //arr.filter() //过滤,过滤一些不合格的元素,如果回调函 阅读全文
摘要:
let arr =[ {title:'aaaa',read:100,hot:true}, {title:'bbbb',read:50,hot:false}, {title:'ccc',read:100,hot:true} ]; let newArr =arr.map((item,index,arr) 阅读全文