Looking for help with updating the indices of array1 in this scenario. Any suggestions on how to make the indices of array2 reference the indices of array1?
var array1 = [
{num:"one"},
{num:"two"},
{num:"three"}
];
var array2 = [];
var i = array1.length;
while(i--){
if(i!=1)array2.push(array1[i]);
}
array2[0].num = "one updated";
console.log(array2);
console.log(array1);
The issue here is that array1[0] remains unchanged.