# Correct syntax for variables

**URL:** <https://forum.kirupa.com/t/correct-syntax-for-variables/247344>\
**Category:** Uncategorized\
**Created:** [December 21, 2007, 1:53pm UTC](https://forum.kirupa.com/t/correct-syntax-for-variables/247344 "2007-12-21T13:53:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimjiminyjimjim](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jimjiminyjimjim](https://forum.kirupa.com/u/jimjiminyjimjim)\
**Post date:** [December 21, 2007, 1:53pm UTC](https://forum.kirupa.com/t/correct-syntax-for-variables/247344/1 "2007-12-21T13:53:15Z")

</div>

I’m trying to do something like this:

```auto

var t = 1;

onMouseDown = function () {

var "dot"+t = "some value";

t++;

}

```

whats the correct syntax for declaring a variable thats name changes according to a different variable.

Thanks
