You have both jQuery.fn.map
   http://docs.jquery.com/Traversing/map

And jQuery.map
   http://docs.jquery.com/Utilities/jQuery.map

Both documented correctly.

--
Ariel Flesler
http://flesler.blogspot.com/

On Aug 19, 5:51 pm, moester <[EMAIL PROTECTED]> wrote:
> 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