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 does have a .sort
method, it just isn't officially documented because it does not follow the usual format of jQuery methods.
The only methods that are supported are the ones listed in the api.
.sort
is implemented as:
$.fn.sort = [].sort;
You can add your own additional array methods as needed in the same way.
$.fn.reverse = [].reverse;
If .sort
isn't implemented in your version of jQuery, implement it yourself.