I'm trying to better understand object relationships in Javascript. I have the following object:
var product = {id: 1, name: 'Test Product', sku: {id: 2, sku: 'ABC'}};
Now, I also set the following variable:
var appSku = product.sku;
If product.sku changes to a new object, will appSku update? Meaning, if somewhere else in the code I do this:
product.sku = {id: 3, sku: 'EFG'};
How can I ensure that the appSku variable gets the new value of product.sku?