I made a little bit of code:
function changeArrElem( arr ) {
arr = [ 23, 63, 85 ];
}
let arr = [];
console.log( arr.join() );
console.log( "" );
changeArrElem( arr );
console.log( arr.join() );
I expected to see initialized array in the function but no. I see nothing. Output is empty. How to pass array by reference to initialize it inside a function?