If I check the type of the Object object it says "function":
typeof Object === "function"
But we all know, that Object has multiple methods such as:
Object.create();
Object.freeze();
Object.seal();
Object.getPrototypeOf();
...
(check https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
My question: how is that possible? How a function is able to have methods? I always thought, that a method is a function that is the value of a property of an object.
Here we use it as an object:
Object.freeze();
and here we use it as a constructor function:
var myObj = new Object();
var myObj2 = Object();
What is "Object" now? It seems it is both: function and object.
Is it a special case because these (Object, Array, String, Number) are the "native constructors"?