Sorry, I didn't mean to sound like I was bringing up an old argument. Like I
said, the argument order to the .each() callback was a done deal, about two
years ago. I brought it up mostly to give some historical context to the
confusing situation we have now.
If jQuery's $().each(), $().map(), and
We already went thru this. I actually backed up agreed with you back
then.
It is not THAT inconsistent though. jQuery utility methods ($.each,
$.map, $.filter) pass "element, index". That's the logical order.
Now, jQuery's prototype methods make the 'this' point to the actual
element. It is common
I should add that I probably wouldn't have gotten this right either. In
fact, I was there at the time when the "index" argument was added to .each()
and I didn't notice the problem myself - and I'd never heard of the new
native [].forEach() yet.
But I do have 20/20 hindsight! ;-)
-Mke
> From: M
Ahh, i wasn't aware there was a jQuery.fn.map -- thanks! (nube
mistake).
Michael, thanks for pointing out the argument order difference between
$.map and $.each. I agree arguing over these historical glitches is
a moot point, but I think the docs could point out these glitches/
gotchas/inconsis
And one heck of an inconsistency, don't you think?
jQuery.each() and jQuery.map() don't pass the arguments to their callbacks
in the same order?! That's definitely a mistake.
Actually, the original order chosen for the arguments to the $(...).each()
and $.each() callbacks was unfortunate. callba
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
6 matches
Mail list logo