Problem: I want to bind the values in an array in a way that when I change one value the other one will change aswell and vice versa.
var array = [1,2,3,1];
array[0] = array[3];
array[0] = 7;
console.log(array[3]) //this will give 1 and I need 7 here.
I figured out a way to do this with objects, but it is not as clean as I would like it to be. My friend told me there was no way this could be done but I doubt it.
array[3]which is of typeNumberin your case, and not reference.