In this lesson let's learn all about the while/do while loops. The while loops works in a similar way to the for loop in that it loops over a block of code. the difference is the initialiser variable is written before and outside of the while loop syntax, and the final expression is included inside the while loop curly braces after the code to be run. Only the condition is included inside the parentheses of a while loop. We'll also learn about the do while loop, the do while loop will run the code at least once before coming on to evaluating the condition.
0 comments:
Post a Comment