while and do while
while checks first and do while runs at least once.
Example
var n = 3;
while (n > 0) { print(n); n--; }
do { print("once"); } while (false);Exercise
Run once first.
{ } while (c);Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.