console.log(Object instanceof Object);
console.log(Object instanceof Function);
console.log(Function instanceof Object);
console.log(Function instanceof Function);
so if Function is an Object and the Object is a Function how come Function === Object and Function == Object are false?
I do understand that checking the instance of an object is not the same as comparison. So the question here is the fuzziness in the case where if two objects (which are actually types) are instances of each other, shouldn't the types be the same?
Note: Object is not an instance of a Number or an Array just an instance of Function.
instanceofrelation is not antisymmetric. Hell, it’s not even reflexive:Number instanceof Numberis false. So why would you expect it to behave like an ordering relation?