Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics Making Decisions in Your Code with Conditional Statements The Conditional Challenge Solution

Bodie Wood
Bodie Wood
Full Stack JavaScript Techdegree Student 4,024 Points

Shouldn't your last else if statement for ranking have the condition (count >= 1) not (count >= 2)?

This is my code and it works great:

let rank = ""; if(score === 5){ rank = "Gold"; }else if(score >= 3){ rank = "Silver"; }else if(score >= 1) { rank = "Bronze"; }else{ rank = "No crown"; }

I think your last else if statement needs to be (score >= 1), not (score >=2 )

1 Answer

Mark Sebeck
Mark Sebeck
Treehouse Moderator 32,258 Points

hi Bodie. Nice catch you are correct. If you take a look at the teachers notes the correction is there

if ( correct === 5 ) {
  rank = "Gold"; 
} else if ( correct >= 3 ) {
  rank = "Silver";  
} else if ( correct >= 1 ) { // check for 1-2 correct
  rank = "Bronze";  
} else {
  rank = "None :(";