[Proto-Scripty] Re: for...in gets a overflow if including scriptaculous and prototype ?

2010-02-22 Thread T.J. Crowder
Hi, That for..in code is incorrect, based on a misconception (a common one). This page explains the misconception and discusses correct ways of iterating through arrays: http://proto-scripty.wikidot.com/prototype:tip-looping-through-arrays HTH, -- T.J. Crowder Independent Software Consultant tj

[Proto-Scripty] Re: for...in gets a overflow if including scriptaculous and prototype ?

2010-02-22 Thread Dale
Thanks! That other way worked fine for me. //Daniel On Feb 22, 4:08 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi, That for..in code is incorrect, based on a misconception (a common one). This page explains the misconception and discusses correct ways of iterating through

[Proto-Scripty] Re: for...in gets a overflow if including scriptaculous and prototype ?

2010-02-22 Thread joe t.
TJ, i see endless warnings against using for/in. And i understand the reasons for them, especially on arrays. But it seems like a fairly powerful looping tool, yet no one seems to temper the warnings with appropriate circumstances for its use. Since the JS spec disallows creating non-enumerable

[Proto-Scripty] Re: for...in gets a overflow if including scriptaculous and prototype ?

2010-02-22 Thread T.J. Crowder
Hey Joe, ARE there any good uses for this loop method? Absolutely, I use it all the time! Remember that as the linked article says: ...`for..in` is not for iterating through the /indexes/ of an /array/. `for..in` iterates through the /property names/ of an /object/. Arrays are objects,