typeof and instanceof Operators
Two different tools for checking a value's type at runtime — one for primitives, one for constructor-based checks on objects.
Determining what kind of value you're holding at runtime is a routine task in JavaScript because the language is dynamically typed, and typeof and instanceof are the two primary tools for it, each suited to different situations. Interviewers ask about these because their edge cases reveal how well you understand JS's type system quirks.
`typeof` is like glancing at a package's shipping label to see if it says 'liquid,' 'solid,' or 'fragile' — a coarse category. `instanceof` is like checking a product's manufacturer stamp to confirm it specifically came from a particular factory (constructor) somewhere down its supply chain (prototype chain).