Yes, there is a difference between jQuery (). map () and jQuery.map ().
To identify some differences:
jQuery.map () = this tends to iterate over a common set
jQuery (). map () = Objects like an array should be transferred to arrays (.makeArray ())
jQuery.map () = is mainly used to get or set a value a set of elements and return this new array
Also .map () is an ECMAScript5 function and is defined outside of jQuery (although implemented). I wonder if jQuery (). Map () was an older version .. map () was obviously faster!
John Resig states: "jQuery.map is primarily intended for use with arrays of DOM elements (as stated in the documentation). For this reason, it does things like strip out null / undefined and it smooths the arrays of nodes into a single array." This is defined in ECMA (Mozilla). Another implementation is Resig itself, hence the difference. This is not a bad design !!!!!! Read
Second reason: "It's not as simple as a" fix "... jQuery.map callback has a param parameter that corresponds to Array.prototype.map, while the jQuery.fn.map param parameter matches all other parameters of the iterator callback request jQuery. or another will tear backwards compatibility, which jQuery is working hard to avoid. " Read
Dane balia
source share