Below is excerpt from Google Developer Console
typeof Object // type of Object is function (most confusing part).
"function" //Same fot all build-in types
Object.constructor
function Function(){[native code]}// Why not function Object()?
Object.hasOwnProperty("create") // Here, it is Object since it has property,not typeof
"true" function
dir(Object) // Again, Object is object,it has property (method)
function Object() { [native code] }
Why typeof Object is not Object ? And why Object.constructor is not a function Object() ?
Thank you MIro
The identifiers Object, String, etc are not "class names" as you might have seen in other languages. Nor are they instances of the specific type.
Object on its own is the constructor for an "Object", i.e. a reference to a function.
To further complicate matters, Javascript functions are also objects, which may have properties. Those properties are often used to add methods to objects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With