0

In JavaScript, what is the difference between

 var stack = {};

and

var stack = [];  
Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
JustMe
  • 147
  • 2
  • 11

1 Answers1

6

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

j08691
  • 204,283
  • 31
  • 260
  • 272
  • @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