you live and learn. M
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Fumio Nonaka > Sent: 19 September 2006 14:38 > To: Flashcoders mailing list > Subject: Re: [Flashcoders] Find item in array > > 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/> > > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > 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 > _______________________________________________ Flashcoders@chattyfig.figleaf.com 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