2012-08-28

What object is not an instance of Object?

Question: What object is not an instance of Object? Or, put differently: What value v makes the following three expressions true?
    typeof v === "object"
    v !== null
    !(v instanceof Object)

Show answer

References

  1. Improving the JavaScript typeof operator
  2. JavaScript values: not everything is an object

2 comments:

Domenic Denicola said...

My first thought was an object from another context (e.g. another frame in the browser). That's kind of the canonical "instanceof fail"

Florian said...

Same here. :)

Web Analytics