I copied obj1 to obj2 but when I make changes in obj2 the object obj1 value is also changing. How to stop this?
let p24: ProductModule=new ProductModule();
p24= this.productlist[g];
p24.variants=[];
p24.variants.push(p.variants[h]);
this.newproductlist.push(p24);
here this.productlist[g]
is an array but when i perform p24.variants=[];
acction value inside this.productlist[g]
also became empty