Microsoft
Software
Hardware
Network
Question : JavaScript: i++ in a loop
Because i++ adds 1, I have to start with -1 for my loop to work:
1: 2: 3: 4:
var i=-1; while(i++<myArray.length-1){ alert(i); }
That code works but it seems awkward. Is there a way better to do this, so that I can start with:
var i = 0;
Related Solutions:
JavaScript: Alert when checkbox value changed
Answer : JavaScript: i++ in a loop
for ( var i = 0; i < myArray.length; i++ ) {
alert( i );
}
Is the common idiom
Random Solutions
how to move email items from one folder to another on a schedule based on a date criteria in outlook.
Data Grid view
stored proc select and update where name field is null
How to set value of a dropdown based on another dropdown
Create Calculated Total MS Access Pivot Table
Execute Immediate
Iphone sending and receiving email when connected to the wireless but not when using 3G
What is a binary tree and how does it work?
asp.net remove item from cache if browser is closed
display the messages to a specific conversation