On Thu, Mar 10, 2011 at 12:40 AM, RobG <[email protected]> wrote:
>
>
> On Mar 10, 9:35 am, RobG <[email protected]> wrote:
> [...]
>> So in the above case it is clearer and sometimes faster (rarely
>> slower) to write:
>>
>>   while (--i) {
>>     a = b[i];
>>   }
>
> Ugh, that will skip the last member, it should have been:
>
>  while (i--) {a = b[i];}
>

A typo or what ? I don't see any difference between the two "while" loops above.

If "i" is the length of the array both will work, or maybe I am too
tired and it's time to sleep ;)

--
Diego


> or
>
>  while (i) {a = b[--i];}
>
> or similar.
>
>
> --
> Rob
>
> --
> To view archived discussions from the original JSMentors Mailman list: 
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here: 
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
>

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to