forEach

4 views
Skip to first unread message

troelskn

unread,
Jun 23, 2006, 8:04:38 AM6/23/06
to MochiKit
prototype's implementation of Array.prototype.each corresponds to
mochikits Iter.forEach. While I was porting a script from prototype to
mochikit, I had some trouble because, each() pass the key of the
iterable as second argument, while forEach() doesn't. For the sake of
compatibility, perhaps it was a good idea to let forEach pass the same
second argument ?

Bob Ippolito

unread,
Jun 23, 2006, 1:56:21 PM6/23/06
to troelskn, MochiKit

No, I don't think so. Prototype compatibility isn't really a goal,
and iterables don't have keys anyway. I don't want it to have
different behavior for arrays and iterables.

-bob

Reply all
Reply to author
Forward
0 new messages