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.