Documentation for version v0.44.0 is no longer actively maintained. The version you are currently viewing is a static snapshot. For up-to-date documentation, see the latest version.
For loop
Refer to Starlark for loop specification for details.
- iterating with values
array:
#@ for i in range(0,3):
- #@ i
- #@ i+1
#@ end
- iterating with index
array:
#@ arr = [1,5,{"key":"val"}]
#@ for i in range(len(arr)):
- val: #@ arr[i]
index: #@ i
#@ end
- use of
continue/break
array:
#@ for i in range(0,3):
#@ if i == 1:
#@ continue
#@ end
- #@ i
- #@ i+1
#@ end
(Help improve our docs: edit this page on GitHub)