PRACTICE / UNDERSTAND / REPEAT

JavaScript: Destructuring

Practice destructuring with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

20 questionsAnswers explainedFree · no login
Question 1 of 20
Destructuring · MCQQuestion link ↗

What does this defaulted destructuring print?

const { count = 1 } = {};
console.log(count);
Choose one answer
Answer & explanation

Answer: 1

A destructuring default applies when the property is missing or undefined.