Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMightyIronElf 15
2,201 PointsPrompts Not Popping Up
I've checked over my code multiple times and I can't find anything wrong. I've checked other questions about this issue and tried all those solutions, but nothing seems to work.
1 Answer
Travis Alstrand
Treehouse Project ReviewerHi there MightyIronElf 15 👋
The issue is an issue with the way the conditional statements are written out currently. We need to close of the condition with a closing )
and then wrap our logic inside of curly braces { }
just as you have in your other conditional block below.
if ( oneAnswer.toUpperCase() === " Robert Downey Jr ") {
correctAnswers += 1;
}
After doing so, you'll likely see this error in the browser's console.
Uncaught SyntaxError: Unexpected token '{' (at quiz.js:73:29)
This is because there is a condition attached to the else
statement on line 73. Only if
and else if
statements are allowed to be assigned conditions, the else
is a final "if everything else didn't work out, do this" statement and it should be removed like so.
} else {
playerRank = "BUMMER! Better luck next time! Try to research some more:)";
}
I hope this makes sense!