Become a member
to unlock all features

Create egghead account to access 5000+ tutorials and resources from expert developers.

Create account

    Create a Copy of an Object in JavaScript


    In this lesson, we'll go over two popular ways to create a copy of an object in JavaScript: Object.assign and using the spread operator. We'll also go over why using these are important, since JavaScript passes object values by reference. Finally, we'll go over nested objects, and why methods such as Lodash's cloneDeep are necessary.