Why are JavaScript primitives not instanceof Object?
Today I happened to have too much time to kill and I played a bit with the Node (v0.10.13) command line: > 1 instanceof Object false > (1).__proto__ {} > (1).__proto__ instanceof Object true > (1).__proto__.__proto__ === Object.prototype true Now, according to MDN , what instanceof does is: The instanceof operator tests whether an object has in its prototype chain the prototype property of a constructor. But clearly Object.prototype IS in 1 's prototype chain. So why is 1 instanceof Object false? Perhaps because 1 is a primitive not an object to begin with? Okay, I accept that, and I did more