0

From some source, I have learned that everything in JavaScript is an object. Then why does the typeof operator return function for Object?

console.log(typeof Object); 
//function
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Anonymous
  • 318
  • 4
  • 14
  • 1
    The same reason that if you pointed at a factory that made cars and asked me what it is, I'd tell you it is a factory (and I wouldn't tell you it was a car) – Quentin Jun 08 '22 at 15:52

1 Answers1

1

Because Object is the constructor for an object.

Elias Soares
  • 9,884
  • 4
  • 29
  • 59