diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-03-27 17:27:52 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-03-27 17:27:52 +0200 |
| commit | f33103cf58f920f8e05ee7fadba9c377095edef8 (patch) | |
| tree | ba6bcfc0243581d7c06ab3b076315ad2001c6da0 /docs | |
| parent | b0f87077cc70f470e0680e0e932747dbe9df9c3b (diff) | |
Add note about arrays of length one
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/src/reference/types.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/src/reference/types.md b/docs/src/reference/types.md index 3dbea5cd..b87b0779 100644 --- a/docs/src/reference/types.md +++ b/docs/src/reference/types.md @@ -470,8 +470,9 @@ Arrays can be added together with the `+` operator, [joined together]($scripting/#blocks) and multiplied with integers. -Empty parenthesis yield an array of length zero and a parentheses-wrapped value -with trailing comma yields an array of length one. +**Note:** An array of length one needs a trailing comma, as in `{(1,)}`. This is +to disambiguate from a simple parenthesized expressions like `{(1 + 2) * 3}`. +An empty array is written as `{()}`. ## Example ```example |
