Hi,

have a look at this url:

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Object_Manipulation_Statements

it defines that it is used to iterate over properties and not array
items. For array items use:

for(var i=0; i<arr.length; i++) {
}

Regards,
Michael


On 7/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I'm doing something like this
>
> var arr = new Array();
> for(var key in arr)
> {
>  var myVal = arr[key];
>  //...Do something with the value.
> }
>
> If you will run this code you will see the for loop will iterate twice
> when it shouldn't iterate at all
>
>
> >
>


-- 
Best regards | Schöne Grüße
Michael

Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer

http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/

Skype: callto:schwarz-interactive
MSN IM: [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" 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/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---

Reply via email to