i have a main array as
arrayVariable = [1,2,3];
and i want another to variables to have the same content as above. If i do
anotherVariable = arrayVariable;
It will just reference that array and they wont be independent of each other. I tried this solution, but it didnt work.
var anotherVariable = arrayVariable.slice();
Edit: Another question, while passing array through a function, does it pass the array or is it passed by reference?
like
var array = [];
someFunction(array);
function someFunction(array){};