Spot the bug in the order label

from Destructuring assignment
Node 24 intermediate 4 min 1 issue to find

Find why the claimed defaults do not make this formatter accept every missing customer shape.

JavaScript
function orderLabel({
  id = 'untracked',
  customer: { name = 'guest' } = {},
} = {}) {
  return `${id}:${name}`;
}

console.log(orderLabel({ id: 'A-17', customer: null }));
Open in playground
Report an error