Values & References13 / 18
Up next

Rebinding is local

const replace = (items) => {
  // rebinding the local name breaks the link to the caller
  items = [9, 9, 9];
  return items;
};
const nums = [1, 2, 3];
const out = replace(nums);
console.log(nums, out);
What you're solving

reassigning a parameter is not seen outside