return num == null ?
// Return a 'clean' array
- Array.prototype.slice.call( this ) :
+ this.toArray() :
// Return just the object
- this[ num ];
+ ( num < 0 ? this.toArray.call(this, num)[0] : this[ num ] );
},
// Take an array of elements and push it onto the stack
equals( jQuery("p").get(0), document.getElementById("firstp"), "Get A Single Element" );
});
+test("get(-Number)",function() {
+ expect(1);
+ equals( jQuery("p").get(-1),
+ document.getElementById("first"),
+ "Get a single element with negative index" )
+})
+
test("add(String|Element|Array|undefined)", function() {
expect(12);
isSet( jQuery("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );