loop loop

loop loop

loop loop

Function

loop is a reserved compatibility form for an unconditional infinite loop. New code can also use for {} to express an infinite loop.

Syntax

Example

Notes

  • It is recommended to use for {} first for new codes, and loop will continue to be compatible.
  • loop usually must be matched with break in the loop body, otherwise the program will keep running.
  • continue will skip the subsequent statements of this round and go directly to the next round.
  • The loop statement itself returns empty.