Unlike to evaluation of a condition, the initial value should be evaluated only once anyway.

for (var i = initialValue(); i<condition(); i++) {}
function initialValue() {
        trace("initial value is evaluated");
        return 0;
}
function condition() {
        trace("condition is evaluated");
        return 3;
}
// [Output]:
initial value is evaluated
condition is evaluated
condition is evaluated
condition is evaluated
condition is evaluated
_____
Mike Mountain wrote:
var l =  myArray.length;
for (var i = l; --i -(-1); ) {}

Then you're not looking up the length on every iteration......
--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My books<http://www.FumioNonaka.com/Books/index.html>
Flash community<http://F-site.org/>

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to