so it's kinda hard to explain ( more that I don't know the terminology for it but that's beside the point) but basically:
var myArray = [1,2,3];
var wantedData = myArray[1];
console.log(wantedData);
myArray[1] = 4;
console.log(wantedData);
so here I changed the array from [1,2,3] to [1,4,3] but the value of wantedData still outputs as 2. Did I do something wrong or would I just have to define it again by doing
var myArray = [1,2,3];
var wantedData = myArray[1];
console.log(wantedData);
myArray[1] = 4;
wantedData = myArray[1];
console.log(wantedData);