> For the complete documentation index, see [llms.txt](https://help.trikset.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.trikset.com/en/studio/programming-visual/expression-syntax/types/array.md).

# Array

An array is one of [the types of TRIK Studio language](/en/studio/programming-visual/expression-syntax/types.md) that stores a set of values ​​(array elements) identified by an index. The numbering of indices in the array starts at 0.

Arrays can be created explicitly using the following expressions (the next lines are equivalent):

```
a = {1; 2; 3; 4};
a = {1, 2, 3, 4};
```

Or with explicit indices:

```
a = {[0] = 1, [10] = 2, [20] = 3};
```

You can use arrays without creating them. For example, like this:

```
a[1] = 1;
a[2] = 2;
```

In this case, "empty spaces" in the array (indices that did not have an explicit assignment) will be filled with default values:

* `0` — for **real** and **integer**;
* `false` *—* for **boolean**;
* *empty lines* for arrays of **strings**.

Array values ​​can also be used without curly braces if used as the return value. For example, this expression will return an array of numbers `1` and `2`:

```
a = 1;
b = 2;
a, b 
```

This is implemented in order to interpret the enumerations of values ​​(for example, the ports of motors in the block ["Motors forward"](/en/trik/programming-visual/blocks.md#motors-forward)) as arrays. Therefore, wherever you use a comma-separated value notation, you can use an array.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.trikset.com/en/studio/programming-visual/expression-syntax/types/array.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
