---
title: "array — Build array"
description: "iXML command array: Build array."
canonical_url: "https://www.zeyos.com/ixml/ref/array"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/array.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# array — Build array

ARRAY builds an array with associated key and value pairs. It may be deeply nested in order to build a multidimensional array.

If the key is omitted within ARRAY or ITEM, a consecutive numeric key will implicitly be generated.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Result variable name |
| key | string | (next consecutive numeric key) | Key |

### Children
- (none)

### Parents
- (not restricted in the reference)

### Result
- binding: var; type: array; predicate: no-result-propagation

### Examples

```xml
<array var="names">
	<item key="bg">Bill Gates</item>
	<item key="sj">Steve Jobs</item>
</array>

<output>$names.bg and $names.sj are competitors!</output>

<!-- Bill Gates and Steve Jobs are competitors! -->
```

```xml
<array var="names">
	<item>Bill Gates</item>
	<item>Steve Jobs</item>
</array>

<output>$names[0] and $names[1] are competitors!</output>

<!-- Bill Gates and Steve Jobs are competitors! -->
```
