InterviewBuddy
All interview questions

What is a shallow copy?

Beginner

Answer

A shallow copy creates a new outer object or array but retains references to nested objects. Mutating a nested object can still affect both structures.