The argument order of the $.map  callback function seems to be
reversed depending on how $.map is used.

>>> arr = ['a','b','c']
["a", "b", "c"]

>>> $.map(arr,function(n,i){return [n,i]})
["a", 0, "b", 1, "c", 2]                                    <--
according to docs

>>> $(arr).map(function(n,i){return [n,i]}).get()
[0, "a", 1, "b", 2, "c"]                                    <--
reverse of docs!!


I realize in the second case one could use 'this' to get the value and
just use one argument for the index, which is more consistent with
other chainable functions.  Perhaps this could be made clear in the
docs or with an example.

Reply via email to