JavaScript·Advanced·Conceptual·1 min read
What does Object.setPrototypeOf cost?
Short interview answer
Changing an existing object's prototype can invalidate engine optimizations and affect later property lookup. Create objects with the desired prototype instead of mutating hot objects.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.