aboutsummaryrefslogtreecommitdiff
path: root/api/arrays.md
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-18 20:00:21 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-18 20:00:21 -0400
commitc338c3f08c6a13242e975dd344bad63a3cec9eee (patch)
tree4e68f126de0bd900ff0556d71cb3a8ed980d3ac9 /api/arrays.md
parentc972b8ba5bd61860e294322336bc9a6e0b3b6d07 (diff)
Update docs
Diffstat (limited to 'api/arrays.md')
-rw-r--r--api/arrays.md5
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