v4 Control Flow

  • add: for (init; cond; post)
  • add: break; and continue;
  • add: && and || (short-circuit)
1 / 4

for loop shape

for (init; cond; post) {
  body
}
  • init once
  • cond before each iteration
  • post after each iteration
2 / 4

break / continue

  • break exits nearest loop
  • continue skips to next iteration
  • both are loop-only
3 / 4

short-circuit logic

  • a && b
    • if a is falsey, skip b
  • a || b
    • if a is truthy, skip b

Result is a boolean.

4 / 4
Use arrow keys or click edges to navigate. Press H to toggle help, F for fullscreen.