Values & References12 / 18
Up next

Functions mutate objects

const appendZero = (items) => {
  // mutating the argument reaches the caller
  items.push(0);
};
const nums = [1, 2, 3];
appendZero(nums);
console.log(nums);
What you're solving

the callee can change your array