---
# System prepended metadata

title: Tag Variables as Object Members

---

# Tag Variables as Object Members

## Example 1
```
<for|item, index| of=[1,2,3]>
  <let/a[index] = item/>
  <effect() {
    console.log(a);
  }/>
</for>
<effect() {
  console.log(a);
}/>
```
### Output

```
{ 0:1, 1:2, 2:3 }
{ 0:1, 1:2, 2:3 }
{ 0:1, 1:2, 2:3 }
{ 0:1, 1:2, 2:3 }
```
or
```
{ 0:1 }
{ 1:2 }
{ 2:3 }
{ 0:1, 1:2, 2:3 }
```
> I vote this one [name=Luke] 

## Example 2
```
<for|item, index| of=[1,2,3]>
  <let/a[index] = item/>
  <effect() {
    console.log(a);
  }/>
</for>
```

## Example 3
```
<for|item, index| of=[1,2,3]>
  <let/a = item/>
  <effect() {
    console.log(a);
  }/>
</for>
```

## Example 4
```
<for|item, index| of=[1,2,3]>
  <let/a.b = item/>
  <effect() {
    console.log(a);
  }/>
</for>
```


## Example ??
```
<for|item, index| of=[1,2,3]>
  <let/a[index] = item/>
  <effect() {
    console.log(a);
  }/>
</for>
```
#### Output Option 1:
```
{ 0:1 }
{ 1:2 }
{ 2:3 }
```

#### Output Option 2:
```
{ 0:1, 1:2, 2:3 }
{ 0:1, 1:2, 2:3 }
{ 0:1, 1:2, 2:3 }
```