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 trialAshley Abid
863 PointsBoolean Bump
I'm not really sure what to put in that middle space between username and password. I tried true but that didn't work. Help, please, Boolean logic befuddles me greatly. D:
if ( username === '' _________ password === '') { alert("Password or user name is missing"); }
2 Answers
Marcus Parsons
15,719 PointsHi Ashley,
The clue as to which boolean operator to use is within the alert box itself. It says "Password or user name is missing." Notice the keyword or there, so that means you need to check if either username or password are missing. The boolean operator for OR logic is two pipe symbols i.e. ||
Ashley Abid
863 PointsOh, thank you! I can't believe it was that simple. :D
Marcus Parsons
15,719 PointsI think sometimes we just overthink the solution too much haha Happy Coding, Ashley! :)