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 trial

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

Bodie Wood
seal-mask
.a{fill-rule:evenodd;}techdegree
Bodie Wood
Full Stack JavaScript Techdegree Student 4,027 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 )

2 Answers

Mark Sebeck
MOD
Mark Sebeck
Treehouse Moderator 37,905 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 :(";
}
Deidra Meek
Deidra Meek
658 Points

I had this same question. Glad I found it before posting a duplicate. :-) Thanks to both of you cuz I was worried I wasn't understanding something.