backbones 中的underscore介绍

访问量: 597

refer to:  http://docs.appcelerator.com/backbone/0.9.2/#Collection-Underscore-Methods

backbone中的underscore提供了28个操作集合的方法.  用好它们可以极大的提高我们的工作效率. 

Underscore Methods (28)
Backbone proxies to Underscore.js to provide 28 iteration functions on Backbone.Collection. They aren't all documented here, but you can take a look at the Underscore documentation for the full details…

forEach (each)  循环

map   映射. 

reduce (foldl, inject)
reduceRight (foldr)
find (detect)
filter (select)
reject
every (all)
some (any)
include
invoke
max
min
sortBy   
groupBy  
sortedIndex
shuffle
toArray
size
first
initial
rest
last
without
indexOf
lastIndexOf
isEmpty
chain

订阅/RSS Feed

Subscribe

分类/category