标签:return let index .so turn eve ever 12px some
1、every
let arr = [0, 1, 2, 3, 4, 5];
let result = arr.every((item, index) => {
return item >= 0
})
结果: result = true
let result = arr.every((item, index) => {
return item > 0
})
结果: result = false
2、some
let arr = [0, 1, 2, 3, 4, 5];
let result = arr.some((item, index) => {
return item >= 5
})
结果: result = true
let arr = [0, 1, 2, 3, 4, 5];
let result = arr.some((item, index) => {
return item > 5
})
结果: result = false
标签:return let index .so turn eve ever 12px some
原文地址:https://www.cnblogs.com/show-me-code/p/10287459.html