0
What is the diference beetwen an array with () or with [ ]?
3 Respuestas
+ 5
https://stackoverflow.com/questions/931872/what-s-the-difference-between-array-and-while-declaring-a-javascript-ar
When you create an array using
var a = [];
You're telling the interpreter to create a new runtime array. No extra processing necessary at all. Done.
If you use:
var a = new Array();
You're telling the interpreter, I want to call the constructor "Array" and generate an object. It then looks up through your execution context to find the constructor to call, and calls it, creating your array.
+ 1
Just a few weeks back ...
https://www.sololearn.com/Discuss/2875591/?ref=app