Crockford writes in <http://javascript.crockford.com/survey.html>:  

*"There are two ways to make a new array:  

 var myArray = [];  

 var myArray = new Array();"*

So I'm confused by these two lines in some AJAX code I am reading:  

```
var obj={};    // obj is an Object object (i.e. a hash table)
obj[4] = 'x';  // now obj is suddenly an Array object via an integer key?

```

In JavaScript are an object and an array really just the same thing, but with a variant on the key type?

In other words, is this the same as in php where we can use *either* a name (string) or an integer for a hash key?

I've Googled for an answer on this but can't seem to nail down an article which discusses this issue.

One possibility that comes to mind is that perhaps the first line is syntactic lint because the 2nd line overwrites the previous definition of obj as it creates a new Array object.