const appendZero = (items) => { // mutating the argument reaches the caller items.push(0); }; const nums = [1, 2, 3]; appendZero(nums); console.log(nums);
the callee can change your array