December 2013
Intermediate to advanced
384 pages
9h 54m
English
var weekdays = ["Mon", "Tue", "Wed", "Thur", "Fri"]; do{ document.write(day); var day = weekdays.pop(); document.write(day+", "); } while (day != "Wed"); //Output is "Fri, Thur, Wed, "
The while(condition){LOOP_BLOCK} and do{LOOP_BLOCK}while(condition); loops allow you to loop through code until a specific condition occurs. The code in your LOOP_BLOCK is executed each time through the loop.
Read now
Unlock full access