...
Solution Review: Shallow to Deep
This lesson will explain the solution to the problem in the previous lesson.
const girl = { name: 'Anna', info: { age: 20, number: 123 }};const newGirl = JSON.parse(JSON.stringify(girl));newGirl.info.age = 30; console.log(girl.info.age)
The above code uses the concept of deep cloning to ...