
- 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]) |
廣告