On Nov 12, 2007 7:27 PM, KKK <[EMAIL PROTECTED]> wrote:

>
> In my apps,i never write 'for in loops'.that's a rule of my program.C/
> Java/C++/C#,i always use "for(int i=0;i<length;i++)".


Yes, but you can't loop through every property of an Object instance without
a for..in loop. The loop you just wrote is only useful for Array-like
objects.

What you need is a couple of conditionals inside the for..in loop. In order
not to repeat those conditionals in every loop (there are about 20 for..in
loops in Prototype), extract the whole idea in a function. You'll probably
end up with something similar like my "Object.prototype vaccine".

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" 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/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to