Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Comments.

  • Loading branch information...
commit 07f7269b6c94c881ecf978418f4fe4c3f5d1a64f 1 parent 0a65a8a
Michael Aufreiter authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 data.js
View
5 data.js
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.