5 ms·
Can't you just use jQuery.fn.sort if you don't want the chaining and wrapper overheard that the parent mentions? And if you do, won't you benefit from native me
by euroclydon 13y ago
Can't you just use jQuery.fn.sort if you don't want the chaining and wrapper overheard that the parent mentions? And if you do, won't you benefit from native methods or polyfills with the same API?
Here is what jQuery.fn.sort looks like in the console of Chrome. It appears to be referencing the native sort:
>jQuery.fn.sort.toString()
"function sort() { [native code] }"
- ivanca 13y agoIt is referencing the native Array.prototype.sort; I just wanted to make a native-only way. Yes, you can use other native methods and polyfills with the same API, for example here is a jQuery plugin for reversing elements: jQuery.fn.reverse = [].reverse;