I’m wondering about why isn’t advisable to use array declaration by:
var arr = new Array()
as I thought declaring by [] was supposed to be protected in case of overwrite Array but…
Array = 1;
var arr = [] // boom
TypeError: Cannot read property 'slice' of undefined
Personally, I prefer using var arr = [],
but now I don’t know what is the advantage of using [] instead of Array except that write faster.
It is under EcmaScript 5 but not under EcmaScript 3, so it won’t be on older browsers.
The relevant portion of the spec is http://es5.github.com/#x11.1.4
The bolded text was added in EcmaScript 5 but was not present in EcmaScript 3.