PRACTICE / UNDERSTAND / REPEAT
JavaScript practice question
Practice destructuring with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
1 questionAnswers explainedFree · no login
Try this question
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.