I have an object
let obj = {
a : [
{
name : 'op'
}]
};
I want to clone it. I used JSON.parse(JSON.stringify(obj))
. But this does not scale well for huge data when used again and again. Is there any other way to shallow copy the object?