Cloning Object
Option - 1 Using for-in
const personCopy = {};
for(let key in person) {
personCopy[key] = person[key];
}
console.log(personCopy);
Option - 2 Using Object.assign
const personCopy = Object.assign({}, person);
console.log(personCopy);
Option - 3 Using spread operator
const personCopy = {...person};
console.log(personCopy);