Is it possible to leave out the variable assignment from a for loop and do something like this…?
otherVar = 3;
for ( otherVar > 0; otherVar-- )
{
stuff
}
Yes, but you need to put in the semi-colon:
var otherVar = 3;
for ( ; otherVar > 0; otherVar-- ) {
doStuff();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With