What does this defaulted destructuring print?
const { count = 1 } = {};
console.log(count);Answer & explanation
Answer: 1
A destructuring default applies when the property is missing or undefined.
Practice destructuring with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
const { count = 1 } = {};
console.log(count);Answer: 1
A destructuring default applies when the property is missing or undefined.