Looping


loop

Executes a block a given number of times.

hello!
hello!
hello!
>>

repeat

repeat is the same as loop, but it has an index that gets incremented each loop

1
2
3
>>

forall

Executes a block as it moves forward in a series.

china japan korea usa
japan korea usa
korea usa
usa
>>

foreach

Executes a block for each element of the series.

china
japan
korea
usa
>>

while

Executes a block while a condition is true.

1
2
3
4
>>

until

Evaluates a block until the block returns a true value.

5
4
3
2
1
0
>>

break

Forces an exit from the loop.

break/return

Forces the exit and sends a given value, like a code or a message, as a return value.

forever

Creates a loop that never ends.

results matching ""

    No results matching ""