Well, I don't know what going on. I'm setting two different attributes in a Custom Lightning Component on init, one is to iteration on UI side and another one is for just reference and it holds the original value.
component.set("v.products", productRatesByInt); component.set("v.productsTemp", productRatesByInt);
Now, if there is any change from the end user on UI, I have a method to handle it and do some changes to its dependent records and that is happening in
productsTemp attribute and then setting its updated value, like below:
component.set('v.productsTemp', productsTemp);// After some change from UI
That works perfectly. But in the same method when I do below
var actualProducts = component.get("v.products");
to get actual/Original Products, which should be without any change, because it is a totally different attribute, but it is not the same. Its records are updated with the temp record's updated value, even though these are two different attributes.
Not sure why this is happening. There is no update/modifications in
v.products during this whole Process. The goal I need to achieve is I want to compare what has been changed from actual record.