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 trialFuad Muhammad
4,273 PointsHow to fix this, I don't understand what's the point of the question.
I'am understand about this part very well. But this question very annoying me. I'am not understand about this point.
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 ( money < 10 && 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.");
}
<!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>
1 Answer
Steven Parker
231,271 PointsThis challenge is about choosing and combining logical (boolean) expressions.
When you need both of two expressions to be true, you would combine them using the AND
operator ("&&
"), and when you only need either of two expressions to be true, you would combine them using the OR
operator ("||
"). So part of the challenge is determining which operation fits the intention of the code and make sure the correct method of combining is used.
The rest is about checking that the correct comparison operator is being used to match the intention of the code. For example, "a < b
" would be the correct operator to check if a was smaller than b, but not if the intention was to check if a and b were the same.
Fuad Muhammad
4,273 PointsFuad Muhammad
4,273 PointsYou are great! Btw, Thank you so much, Finally, I've done. :)