I was reading Learning jQuery 1.3 (Jonathan Chaffer and Karl Swedberg) and while sorting table, they used .get()
before calling .sort()
, and said <
jQuery objects currently support 3 array methods:
var methods = 'pop push reverse shift sort splice unshift concat join slice toString indexOf lastIndexOf filter forEach every map some reduce reduceRight'.split(' ')
var implemented = $.grep(methods, function(m) {
return $.prototype[m] == Array.prototype[m];
});
console.log(implemented); // => ["push", "sort", "splice"]
They also have slice
, but it's not the same slice
as arrays have:
$.prototype.slice === Array.prototype.slice // => false