I don't understand the assignment operator when assigning objects (say, arrays). I'm told that as assignment operator copies the **reference**. However it seems like it copies the data. For example:

```
var globArray = [];

function test() {
  var names = ["craig", "silva"];
  globArray = names;
}//endFunction test

function test2() {
  console.log("el1: ", globArray[0], "el2: ", globArray[1]);
}//endFunction test2

```

When I call TEST, it creates array NAMES and assigns the global array "globArray" to NAMES. Now it goes out of scope, so "names" is gone, right? Then later I call test2, but it DOES show the elements! So it must have COPIED the whole object, as opposed to just coping the reference.

Can someone explain this?