# Loop ## Function loop is used to repeatedly execute a section of code. BT provides three types of loops: `for` supports times, intervals, infinite loops and set traversals, `while` loops based on conditions, and `loop` is reserved as a compatible infinite loop writing method. ## Loop control - `break`: End the current loop. - `continue`: Skip the current round and enter the next round. - `break:label`/`continue:label`: Control loops of specified tags in nested loops. ## Examples ```bt for index, value in [1, 2, 3] { if value == 2 { continue } println value } ``` ## Syntax document - [for](/en/docs/loop/for): count loop, interval loop, infinite loop, and traverse arrays, objects and strings. - [while](/en/docs/loop/while): Loop conditionally. - [loop](/en/docs/loop/loop): Compatible infinite loop writing method, where the loop body determines when to exit.