diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-18 20:00:21 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-18 20:00:21 -0400 |
| commit | c338c3f08c6a13242e975dd344bad63a3cec9eee (patch) | |
| tree | 4e68f126de0bd900ff0556d71cb3a8ed980d3ac9 /api/arrays.md | |
| parent | c972b8ba5bd61860e294322336bc9a6e0b3b6d07 (diff) | |
Update docs
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 |
