4

I'm reading the JavaScript The Definitive Guide and it says:

The easiest way to create an array is with an array literal

But then it says:

Another way to create an array is with the Array() constructor.

My question is, no matter how we declare an array in javascript, does it continue being an object? Thanks

Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208
GniruT
  • 731
  • 1
  • 6
  • 14
  • http://stackoverflow.com/questions/931872/what-s-the-difference-between-array-and-while-declaring-a-javascript-ar – epascarello Oct 07 '15 at 13:24

1 Answers1

6

Yep, both are objects:

typeof []; // "object"
typeof new Array(); // "object"
John Strickler
  • 25,151
  • 4
  • 52
  • 68