Interview Q&A / JavaScript
JavaScript interview questions
Closures, the event loop, this, promises and the core language questions every frontend round asks.
Prefer rapid revision? Practise JavaScript short interview answers →
- What is the difference between a shallow copy and a deep copy of an object?
A shallow copy duplicates only the top level, so nested objects are still shared with the original. A deep copy duplicates every level, so the two are fully independent. Spread and Object.assign are shallow; structuredClone is deep.
BeginnerQuick answer1 min read