View Single Post
Old 01-05-2013, 03:55 AM   PM User | #17
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,993 Times in 3,962 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
That is, of course, not the same forEach that I created.

I don't like the built in forEach very much. It just doesn't make intuitive sense that the this in the callback function has to refer to the second argument of the method.

It makes it feel like the callback is a method *ON* that second argument. Which I guess it is. But it's just weird.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.

Last edited by Old Pedant; 01-05-2013 at 04:00 AM..
Old Pedant is offline   Reply With Quote