On Sat, 24 Apr 2004 09:42:56 -0500, MikeB <m.byerleyATVerizonDottieNettie>
wrote:
[snip]
for (c = 'a'.charCodeAt(0);c <= 'r'.charCodeAt(0);c++)
The second function call should be taken outside the loop. The "condition"
expression will be evaluated on each loop iteration, which means you're
adding an extra function call for no reason. Whilst this particular case
won't have much impact, re-evaluating object properties or repeatedly
calling functions can introduce a relatively significant overhead.
Invariant optimisation is good habit to get into.
Mike
Please trim your quotes.
--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)