tablica przepustki JavaScript według wartości
// example of pass array by value
let arr = [ 1 , 2 , 3 ];
// new Array => constructor take args & make array using it
// ...arr => just extract all array elements in this place
let arr_copy = new Array( ...arr ); // pass by value
arr_copy[0] = 99; // proof :)
console.log( arr ); // output => [ 1 , 2 , 3 ]
console.log( arr_copy ); // output => [ 99 , 2 , 3 ]
mourad