var a = [], // these are the sameb = new Array(), // a and b are arrays with length 0
c = ['foo', 'bar'], // these are the samed = new Array('foo', 'bar'), // c and d are arrays with 2 strings
// these are different:e = [3] // e.length == 1, e[0] == 3f = new Array(3), // f.length == 3, f[0] == undefined
;
function Array() {this.is = 'SPARTA';}
var a = new Array();var b = [];
alert(a.is); // => 'SPARTA'alert(b.is); // => undefineda.push('Woa'); // => TypeError: a.push is not a functionb.push('Woa'); // => 1 (OK)
> [][]> new Array()[]> [] == []false> [] === []false> new Array() == new Array()false> new Array() === new Array()false> typeof ([])"object"> typeof (new Array())"object"> [] === new Array()false> [] == new Array()false
var test1 = [];test1.push("value");test1.push("value2");
var test2 = new Array();test2.push("value");test2.push("value2");
alert(test1);alert(test2);alert(test1 == test2);alert(test1.value == test2.value);