On May 24, 1:53 pm, tobie <[EMAIL PROTECTED]> wrote:
> > The only time for..in should be used with Array is for (very) sparse
> > arrays to save time when iterating over its elements.
>
> for...in is way slower than the regular for(var i = 0, len =
> array.length; i < len; i++)

Except when used in (very) sparse arrays...


> for..in should NEVER be used over arrays except to do what it's meant

There's an old saying:  never say never  ;-)

> to: iterate over properties.

The indices of an array *are* properties.


--
Rob


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to