mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Add note about arrays of length one
This commit is contained in:
parent
b0f87077cc
commit
f33103cf58
@ -470,8 +470,9 @@ Arrays can be added together with the `+` operator,
|
|||||||
[joined together]($scripting/#blocks) and multiplied with
|
[joined together]($scripting/#blocks) and multiplied with
|
||||||
integers.
|
integers.
|
||||||
|
|
||||||
Empty parenthesis yield an array of length zero and a parentheses-wrapped value
|
**Note:** An array of length one needs a trailing comma, as in `{(1,)}`. This is
|
||||||
with trailing comma yields an array of length one.
|
to disambiguate from a simple parenthesized expressions like `{(1 + 2) * 3}`.
|
||||||
|
An empty array is written as `{()}`.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
```example
|
```example
|
||||||
|
Loading…
x
Reference in New Issue
Block a user