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

L MOHAN ARUN
L MOHAN ARUN
769 Points

Error in question. Recheck suggested.

Error in question. Recheck suggested.

Gavin Ralston
Gavin Ralston
28,770 Points

It would be helpful if you provided the code you tried to submit for this challenge so we can compare it to the instructions.

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

So, your problem lies within all the conditionals.

For the first three, you need to replace the OR comparison with the AND (&&), because both conditions need to be met in order for the code to execute. money has to be True AND today MUST be Friday.

The way you have it ( using || ) will return a True on the first conditional, because with the OR comparison, only ONE needs to return True. Since the day is hard coded as Friday, using OR will return True and not even parse the remain code.

Your today === 'Friday' is correct.

Does that help? :)

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi there and welcome to Treehouse.

There is no error in the code challenge. I just completed it with a Pass.

Gavin is right. If you could post the code you are trying, we would be able to help you troubleshoot your code.

:)

L MOHAN ARUN
L MOHAN ARUN
769 Points

This is the code I tried to submit to the Treehouse web application.

var money = 9;
var today = 'Friday';

if ( money >= 100 || today === 'Friday' ) {
  alert("Time to go to the theater");    
} else if ( money >= 50 || today === 'Friday' ) {
  alert("Time for a movie and dinner");    
} else if ( money > 10 || today === 'Friday' ) {
  alert("Time for a movie");   
} else if ( today === 'Friday' ) {
  alert("It's Friday, but I don't have enough money to go out");   
} else {
  alert("This isn't Friday. I need to stay home.");
}

Thx Blog:http://www.mohanarun.com/wordpress/