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 (Retired) Making Decisions with Conditional Statements The Conditional Challenge Solution

Todd Breeze
Todd Breeze
926 Points

I have looked at everyone elses code and i don't have the same errors but i get 4 out 5 right every time

heres my code

var correct = 0; var total = correct;

var answer1 = prompt('Is Candice older than Ivy?'); if(answer1.toUpperCase() === 'TRUE' || 'YES'){ correct += 1; } var answer2 = prompt('Is Keith Breeze a plumber or a builder??'); if(answer2.toUpperCase() === 'PLUMBER'){ correct += 1; } var answer3 = prompt('Is Ivy 6 years old?'); if(answer3.toUpperCase() === 'FALSE' || 'NO'){ correct += 1; } var answer4 = prompt('Can Ebony fart loud?'); if(answer4.toUpperCase() === 'TRUE' || 'YES'){ correct += 1; } var answer5 = prompt('Does Todd love Candice?'); if(answer5.toUpperCase() === 'TRUE' || 'YES'){ correct += 1; }

//document.write(correct); if(total === 5){ alert('Congratulations you got a gold medal!'); }else if(total === 2 || 3){ alert('Congratulations you got a silver medal!'); }else if(total === 1 || 2){ alert('Congratulations you got a bronze medal!'); }else{ alert('Better luck next time!'); }

2 Answers

Todd Breeze
Todd Breeze
926 Points

Yes that's it thank you so much and for the prompt reply =)