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 trialwilliam clark
698 PointsPlease help, I am completely confused
Can someone please help me?
var money = 10;
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' || money > 9 ) {
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.");
}
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
2 Answers
Piotr Manczak
Front End Web Development Techdegree Graduate 29,363 PointsFirst three conditional statements should be written with && instead of ||.
Brian Johnson
Front End Web Development Techdegree Graduate 20,818 PointsHey Will so I think the original challenge had a 9 assigned to the money variable. If you change the variables you won't pass the challenge. Also remember the challenge wants you adjust what is "INSIDE" the conditional statements, so when the code checks the arguments it will pass TRUE for both conditions. There is a logical operator you want to use here so you can check both conditions.. You notice in this code the operator is the "||". This operator only requires one of the conditions to be true and you want to use another operator. Mr. Piotr gave you a hint. Try to redo it and let us know!