Back

backbones 中的underscore介绍

发布时间: 2015-04-04 02:36:00

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

Back