JavaScript·Intermediate·Conceptual·1 min read
How does instanceof work?
Short interview answer
It generally checks whether the constructor's prototype object appears in the candidate object's prototype chain, with Symbol.hasInstance allowing customized behavior.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.