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
  • 92,299
  • 16
  • 152
  • 142
Akash Sateesh
  • 231
  • 2
  • 4
  • 12

0 Answers0