> For the complete documentation index, see [llms.txt](https://sevenval.gitbook.io/flat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sevenval.gitbook.io/flat/reference/functions/array.md).

# array()

```
node-set array([node-set nodes])
```

wraps the nodes of the node set `nodes` in a `<json array="">…</json>` structure, so that they can be used as an array in a [JSON Template](/flat/reference/templating.md).

if the `nodes` contain an attribute (e.g. `a="b"`), it will be converted to an element `<value name="a">b</value>`), so that key and value are easily accessible in the template.

## Example

JSON:

```javascript
{"users": [ {"name": "Alice"},{"name": "Bob"}]}
```

Template-Action:

```markup
<template>
   { "names": {{ array(users//name) }} }
</template>
```

Output:

```javascript
{ "names": ["Alice","Bob"] }
```
