Solution Review: Shallow to Deep
This lesson will explain the solution to the problem in the previous lesson.
We'll cover the following...
Solution #
Press + to interact
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)