What exactly is happening here at the line( param = [1]) when passing the data, that the output is 0? If I switch the lines inside the function I get [0,2].
const data = [0];
function changeData(param) {
param = [1]
param.push(2);
}
changeData(data);