Reputation: 110972
How to iterate over a range, lets say from the 3. to 10., of a Backbone collection?
Upvotes: 4
Views: 1868
Reputation: 1145
As opposed to slicing, you can be a bit more direct by using the collection's at method.
for (var idx=3;idx<=10;++idx) {
var model = collection.at(idx);
...do something...
}
Upvotes: 1