- Underscore.JS 教程
- Underscore.JS——主页
- Underscore.JS——概述
- Underscore.JS——环境设置
- Underscore.JS——迭代集合
- Underscore.JS——处理集合
- Underscore.JS——迭代数组
- Underscore.JS——处理数组
- Underscore.JS——函数
- Underscore.JS——映射对象
- Underscore.JS——更新对象
- Underscore.JS——比较对象
- Underscore.JS——实用程序
- Underscore.JS——链式
- Underscore.JS 有用资源
- Underscore.JS——快速指南
- Underscore.JS——有用资源
- Underscore.JS——讨论
Underscore.JS——迭代数组
Underscore.JS 有许多易用方法,有助于迭代数组。本章针对它们进行了详细讨论。
Underscore.JS 提供了各种方法来迭代数组,如下所列——
序列号 | 方法和句法 |
---|---|
1 | first
_.first(array, [n]) |
2 | initial
_.initial(array, [n]) |
3 | last
_.last(array, [n]) |
4 | rest
_.rest(array, [index]) |
5 | indexOf
_.indexOf(array, value, [isSorted]) |
6 | lastIndexOf
_.lastIndexOf(array, value, [fromIndex]) |
7 | sortedIndex
_.sortedIndex(array, value, [iteratee], [context]) |
8 | findIndex
_.findIndex(array, predicate, [context]) |
9 | findLastIndex
_.findLastIndex(array, predicate, [context]) |
广告