angularjs clone object code example
Example: how to clone a object in javascript angular
const food = { beef: 'b', bacon: 'a' }
// "Spread"
{ ...food }
// "Object.assign"
Object.assign({}, food)
// "JSON"
JSON.parse(JSON.stringify(food))
const food = { beef: 'b', bacon: 'a' }
// "Spread"
{ ...food }
// "Object.assign"
Object.assign({}, food)
// "JSON"
JSON.parse(JSON.stringify(food))