What does this destructuring default print?

Simple JavaScript output question.

const { a = 5 } = { a: undefined };
console.log(a);

What is the output and why.

Ellen :blush:

It prints 5, because destructuring defaults kick in when the property value is undefined-if it were null, you’d get null instead.

Yoshiii