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 trialDagur Freyr Guðbrandsson
Front End Web Development Techdegree Student 2,379 Pointswhats does || mean?
i cant remember what this means so that means i am stuck
2 Answers
Billy Le
23,209 Pointsthe || means OR. It's a logical operator to check if the conditions on either side of the || is true or false.
James Matthews
21,610 PointsHi dude!
|| in JavaScript is the logical OR operator. Logical operators are used to combine multiple tests into a single condition, such as:
if (99 < score || score < 99) {
document.write('<p>Who cares what ur score is! Nice job!</p>');
}
In this condition, the result will return true if score is greater than 99, OR if score is less than 99.