Spot the mistake updating this mystery prize label.
const prizeBox = document.querySelector("#prize-box");
const newBadge = document.createElement("span");
newBadge.textContent = "⭐ Golden Turnip";
prizeBox.appendChild = newBadge;
Reply with what is broken and how you would fix it.
The appendChild method is being incorrectly assigned as a property instead of being called as a function. It should be prizeBox.appendChild(newBadge); to add the new element.
Spot the Bug answer: The appendChild method is incorrectly assigned a value instead of being called as a function.
The fix:
prizeBox.appendChild(newBadge);
Why:
In JavaScript, appendChild is a method that needs to be invoked with parentheses, passing the element to be appended as an argument. Assigning a value to it like ‘appendChild = newBadge’ attempts to overwrite the method itself, which will not add the newBadge to the DOM.
First-answer leaderboard
- @emmawalter5 - 15 (firsts)

- @Apexcodes - 9 (firsts)
- @kirupa - 8 (firsts)
- @PipMuse - 4 (firsts)
- @adnanahmed - 2 (firsts)
Nice catch — that one is so easy to skim right past, because the line looks almost right until you notice it never actually does anything.
Spotting the assignment-versus-call difference that cleanly is exactly the kind of thing that saves a lot of head-scratching later.