diff options
Diffstat (limited to 'api/arrays.md')
| -rw-r--r-- | api/arrays.md | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api/arrays.md b/api/arrays.md index 8933ff1e..34da6e8f 100644 --- a/api/arrays.md +++ b/api/arrays.md @@ -21,6 +21,8 @@ like this: empty := [:Int] ``` +For type annotations, an array that holds items with type `T` is written as `[T]`. + ### Array Comprehensions Arrays can also use comprehensions, where you specify how to dynamically create @@ -76,6 +78,9 @@ You can iterate over the items in an array like this: ```tomo for item in array: ... + +for i, item in array: + ... ``` Array iteration operates over the value of the array when the loop began, so |
