loading
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const _ = require('lodash');


let data = {
  "id" : 1,
  "name" : "john",
  "address" : {
    "street" : "Sample",
    "country" : "Earth",
    "Street" : "Madison street"
  }
}

// copydata = Object.assign({},data);

let copydata = _.cloneDeep(data)

data.address.street = "Changed Street";

console.log("data => ",data);

console.log("==================================================================");


console.log("copydata =>",copydata)
node v10.16.0