When an object has more objects inside, Object.Assign
doesn't do the trick.
The easist way to do it:
var originalObject = {
p: new Date(),
a: 123,
otherObj: {
m: 'more data',
objOtherOne: {
c: 'x'
}
}
}
var copy2 = JSON.parse(JSON.stringify(originalObject));