Quote:
|
quote:when writing a js incrementing loop, should i use option 1 or 2, either, i++ or ++i?
|
Code:
for(var i=0; i<iNoOfOpts; ++i)
is the same as
Code:
for(var i=1; i<iNoOfOpts; i++)
Quote:
|
quote:are there any performance reasons here?
|
i don't know whether there are performance reasons
but there might be memory differences
cos in the first example ("var i=1") the variable 'i' is
declared as local and in the second it becomes global