数组之ES5 方法
2018-05-28 本文已影响0人
樱木夜访流川枫
语法:arr.Fn(callback[, thisArg])
1.不提供返回值:
foreach
2.提供返回值,返回新数组:
filter、map
3.提供返回值、返回布尔值:
every、some
4.提供返回值,返回数组的某个元素或索引:
find、findIndex
5.提供返回值,返回累积值:
reduce、reduceRight
语法:arr.Fn(callback[, thisArg])
1.不提供返回值:
foreach
2.提供返回值,返回新数组:
filter、map
3.提供返回值、返回布尔值:
every、some
4.提供返回值,返回数组的某个元素或索引:
find、findIndex
5.提供返回值,返回累积值:
reduce、reduceRight