In the below code :-
var x = { } ;
console.log(typeof x); // o/p is object
console.log(x instanceof Object ); //o/p is true
If I use "object" instead of "Object" in the last line I get an error.Why is that so when the o/p of second line is object with a lowercase "o"?
Object, notobject.typeofdoesn't return the constructor that was used to create the instance, it simply returns a few predefined values depending on what argument it was used with.typeof ""returns'string', but there is nostringobject defined unless you define one.