Question: My code looks similarly to this:

I create variable:

```
var person1;

```

Than I add this to array:

```
var people = [];
people.push(person1);

```

And finally I define what "person1" is:

```
person1 = new Person("Mike", 25, "London");

```

The problem is, people that are defined after pushing to array are undefined. For some reasons I can't define all people before putting to array. As I see, "people.push(person1);" actually puts copy of this variable to array. It is possible to do, that I put only reference of variable to the array?

Answer: 
There are no pointers in javascript. `person1` is not going to be a pointer.

This variable is going to reference a value. When the variable is used, the **current** value is referenced. So, when this is used:

```
var person1;
people = [];
people.push(person1);

```

`undefined` shows up because that is what the current value of `person1` was. Any future change to `person1` will change the value of `person1`, but it will not affect any of the values in the `person` array.

It would be more appropriate to take a simpler approach here and just pass in the new value you create

```
people = [];
people.push(new Person("Mike",25,"London"));

```
The only thing you can do is:

```
var person1 = new Person();
var people  = [];
people.push(person1);

people[0].name = "Mike";
people[0].age  = 25;
people[0].city = "London";

```