0

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?

Mayank Shukla
  • 100,735
  • 18
  • 158
  • 142
Akash Sateesh
  • 271
  • 2
  • 4
  • 13

0 Answers0