# Var this\["myVariable" + i\] = new Object();

**URL:** <https://forum.kirupa.com/t/var-this-myvariable-i-new-object/157239>\
**Category:** Uncategorized\
**Created:** [July 31, 2005, 9:50am UTC](https://forum.kirupa.com/t/var-this-myvariable-i-new-object/157239 "2005-07-31T09:50:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![OM2](https://avatars.discourse-cdn.com/v4/letter/o/3ab097/32.png) [@OM2](https://forum.kirupa.com/u/OM2)\
**Post date:** [July 31, 2005, 9:50am UTC](https://forum.kirupa.com/t/var-this-myvariable-i-new-object/157239/1 "2005-07-31T09:50:58Z")

</div>

I want to have the following code:

```auto
var this["myVariable" + i] = new Object();

```

The compiler throws an error.

I’ve also tried:

```auto
var eval("myVariable" + i) = new Object();

```

This also gets rejected.

I need to have the code in a for loop and hence the syntax.

Where am I going wrong?

Thanks.

OM
