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
looping array makes array not empty, even though reset applied at start of loop
Blocking the Escape key.
eCommerce in .NET
Unable to access coldfusion 9 administrator
Search through a PHP object array
Display subform data linked to multiple data on main form
Do I need Enterprise Class Harddrives in a Non Mission Critical Server ?
Error in findfirst file size
Free Alternative Of Ms Sharepont Server
Alignment on Datagrid not proper