Make toArray an alias for .get(). Closes #3999
This commit is contained in:
parent
0e2f4a0fe3
commit
e124fec5e9
2 changed files with 10 additions and 1 deletions
|
@ -122,6 +122,8 @@ jQuery.fn = jQuery.prototype = {
|
||||||
return this.length;
|
return this.length;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toArray: Array.prototype.slice,
|
||||||
|
|
||||||
// Get the Nth element in the matched element set OR
|
// Get the Nth element in the matched element set OR
|
||||||
// Get the whole matched element set as a clean array
|
// Get the whole matched element set as a clean array
|
||||||
get: function( num ) {
|
get: function( num ) {
|
||||||
|
|
|
@ -328,6 +328,13 @@ test("get()", function() {
|
||||||
isSet( jQuery("p").get(), q("firstp","ap","sndp","en","sap","first"), "Get All Elements" );
|
isSet( jQuery("p").get(), q("firstp","ap","sndp","en","sap","first"), "Get All Elements" );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("toArray()", function() {
|
||||||
|
expect(1);
|
||||||
|
isSet ( jQuery("p").toArray(),
|
||||||
|
q("firstp","ap","sndp","en","sap","first"),
|
||||||
|
"Convert jQuery object to an Array" )
|
||||||
|
})
|
||||||
|
|
||||||
test("get(Number)", function() {
|
test("get(Number)", function() {
|
||||||
expect(1);
|
expect(1);
|
||||||
equals( jQuery("p").get(0), document.getElementById("firstp"), "Get A Single Element" );
|
equals( jQuery("p").get(0), document.getElementById("firstp"), "Get A Single Element" );
|
||||||
|
|
Loading…
Add table
Reference in a new issue