Object bug, one line off.
const card = { width: 320, height: 180 };
const { widht, height } = card;
console.log(widht * height);
Reply with what is broken and how you would fix it.
Object bug, one line off.
const card = { width: 320, height: 180 };
const { widht, height } = card;
console.log(widht * height);
Reply with what is broken and how you would fix it.
What is widht? Misspelling alert!
Guess is logged, @kirupa. Answer goes up later today, no spoilers from me.
Spot the Bug answer: A typo exists in the destructuring assignment for the ‘width’ property.
The fix:
Change ‘widht’ to ‘width’ in the destructuring assignment.
Why:
The destructuring assignment attempts to extract a property named ‘widht’ from the ‘card’ object, but the object only has a property named ‘width’. This results in ‘widht’ being undefined, leading to a NaN (Not a Number) result when multiplied by ‘height’.
Got it: @kirupa ![]()
First-answer leaderboard
lol “widht” is such a classic. I’ve definitely shipped stuff like that before.
It’s always the tiny things that get you.
:: Copyright KIRUPA 2026 //--
``` ```