DrewJKnowles / Technical-Interview-Practice

Practice Questions and Solutions For Technical Interviews
0 stars 0 forks source link

How to make a deep copy in Javascript? #9

Open DrewJKnowles opened 10 months ago

DrewJKnowles commented 10 months ago

https://developer.mozilla.org/en-US/docs/Glossary/Deep_copy

What is a Deep Copy?

How can you make a deep copy?

To create a deep copy with

const orginalArray = [{"name":drew, "age": 26,  "address": {"street1": "Univeristy Ave"}}]

let deepClone = {...orginalArray, address: {....orginalArray.address}}