Unverified Commit 809c0395 authored by Joel Copi's avatar Joel Copi Committed by GitHub
Browse files

Added first, index, and length methods

parent 2cdc2989
......@@ -308,7 +308,15 @@ Selector.prototype = {
return this;
},
first: function () {
return this.elements[0];
},
index: function (num) {
return this.elements[num];
},
length: function () {
return this.elements.length;
},
and: function (sel) {
// O(n*m)
if (!(sel instanceof Selector))
......@@ -376,4 +384,4 @@ Selector.prototype = {
$.utils.array.removeDuplicates(this.elements);
return this;
}
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment