0

I was wondering if there were a difference between:

var list = []; 

and

var list = new Array();
Stephane Rolland
  • 38,876
  • 35
  • 121
  • 169
  • 2
    http://stackoverflow.com/questions/885156/whats-wrong-with-var-x-new-array – Sergio Sep 23 '13 at 20:07
  • I've seen answers that say `var list = new Array();` takes more horsepower to execute – MonkeyZeus Sep 23 '13 at 20:07
  • @dandavis Actually they're not, but they're similar. Biggest danger is that `Array` doesn't need to be a "real" `Array`, while the literal syntax guarantees it. And at least in some scenarios is slower, although I doubt that really matters. – Dave Newton Sep 23 '13 at 20:23
  • @DaveNewton: ok fine. as long as Array is native, they are the same. I would imagine that nearly always the case... – dandavis Sep 23 '13 at 20:25

0 Answers0