What does the typeof operator return for an array in JavaScript?

  • 'array'
  • 'object'
  • 'string'
  • 'undefined'
The typeof operator in JavaScript returns 'object' for an array. Despite arrays being a specific type of object, typeof doesn't distinguish them from generic objects.
Add your answer
Loading...