管理员
|
阅读:3835回复:1
es6: map every some filter 区别
楼主#
更多
发布于:2020-09-15 10:03
let arr=[1,2,3,4,5,6]; function chooseNum(num){ return num>3;}console.log(arr.map(chooseNum));console.log(arr.every(chooseNum));console.log(arr.some(chooseNum));console.log(arr.filter(chooseNum)); 打印结果:
|