Permalink
Browse files

Comments.

  • Loading branch information...
1 parent 0a65a8a commit 07f7269b6c94c881ecf978418f4fe4c3f5d1a64f Michael Aufreiter committed May 2, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 data.js
View
@@ -541,17 +541,20 @@
return this;
},
+ // First object of the collection
first: function() {
return this.length > 0 ? this.objects[0] : null;
},
+ // Last object of the collection
last: function() {
return this.length > 0 ? this.objects[this.length-1] : null;
},
+ // Returns a sub-range of the current collection.
range: function(start, end) {
var result = Data.Collection.create(this.type, []);
- for(var i=start; i<=end && i<this.objects.length; i++) {
+ for(var i = start; i <= end && i < this.objects.length; i++) {
result.add(this.at(i));
}
return result;

0 comments on commit 07f7269

Please sign in to comment.