0

In JavaScript, what is the difference between

 var stack = {};

and

var stack = [];  
Felix Kling
  • 756,363
  • 169
  • 1,062
  • 1,111
JustMe
  • 147
  • 1
  • 11

1 Answers1

6

The first one is an empty object and the second is an empty array.

j08691
  • 197,815
  • 30
  • 248
  • 265
  • @Neal - My hands shake so they usually fly over the keyboard pretty fast. Usually I end up with loads of typos but this time I got lucky ;) – j08691 Jul 08 '13 at 20:05