# Phaser3 Array Question

**URL:** <https://phaser.discourse.group/t/phaser3-array-question/11179>\
**Category:** Phaser 3\
**Created:** [February 5, 2022, 6:44am UTC](https://phaser.discourse.group/t/phaser3-array-question/11179 "2022-02-05T06:44:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bronze2](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/bronze2/32/6139_2.png) [@Bronze2](https://phaser.discourse.group/u/Bronze2)\
**Post date:** [February 5, 2022, 6:44am UTC](https://phaser.discourse.group/t/phaser3-array-question/11179/1 "2022-02-05T06:44:51Z")

</div>

I used an English translator.  
For example, in c++, you can access the elements you want by int a[10]; a[5]=0. But I’m not sure what to do in Phaser 3 typescript. I want to put five objects in an array and manage the desired object.  
code:

```javascript
LifeGroup = this.add.group();

for (let i = 0; i < 5; i++) {
  let ifeGroup = this.add.image(60 * (i + 1), 60, "HP");
  ifeGroup.setActive(false);
  ifeGroup.setVisible(false);
  this.LifeGroup.add(ifeGroup);
}

LifeGroup[3].setActive(true);

```

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [February 5, 2022, 5:19pm UTC](https://phaser.discourse.group/t/phaser3-array-question/11179/2 "2022-02-05T17:19:42Z")

</div>

```
LifeGroup.getChildren()[3].setActive(true);
```
