Question: I have a function defined that way:

```
var myObject = new Object();

    function myFunction(someString){

         myObject.someString= 0;

    }

```

The problem is `someString` is taken as the string `someString` instead of the value of that variable.

So, after I use that function several times over with different `someString`'s, I would like to get an object with all the values for each someString.

But when I loop through that object
The only result I get is `someString : 0`

I want to get:

```
John : 0
James : 0
Alex : 0 etc....

```

How do I do that? Thanks a lot in advance

Answer: 
You can use the associative array approach:

```
var someString = 'asdf';

myObject[someString] = 0; // {asdf: 0}
myObject['foo'] = 'bar';

```

You can basically use any string to retrieve your method/parameter.

```
var i = 1;
myObject['test' + i] = i + 1; // gives us {test1: 2}

```
Try this

```
var myObject = new Object();
    function myFunction(someString){
        myObject[someString]= 0;
    }

```