Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Instruction

Beware of Infinite Loops!

One important concept you should keep in mind about loops is the infinite loop. An infinite loop, as the name suggests, is a loop that keeps running forever.

For example, a while loop's condition gets evaluated before the loop runs. That is, if the test condition is true at the beginning, the loop runs:

while ( condition ) {
  // execute code if condition is true
}

...