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 trialRen Dreamur
Python Web Development Techdegree Student 8,587 PointsWhat does || mean in javascript (Treehouse Club - MASH question)
As the question says.
3 Answers
Alexander Davison
65,469 Points|| Means "or".
So if you wanted to test if either condition is true, then use ||.
If any condition is true, the whole thing is true. If all conditions are false, then the whole thing is false.
Example:
var name = "Alex";
if (name == "Alex" || name == "Ren") {
document.write("Oh hi! I know you!");
}
This program will print "Oh hi! I know you!" if name
is either "Alex" or "Ren".
I hope you understand now :)
Good luck! ~alex
Alexander Davison
65,469 PointsPython and Front-end development (HTML CSS and JS)
Tommy Gebru
30,164 PointsI wanted to just reach out to see if you are interested in becoming a moderator for treehouse, but also wanted to take the opportunity to say hello to another local developer I went to my first meetup this past week, have you ever attended workshops, or events?
Alexander Davison
65,469 PointsNo I haven't.
Alexander Davison
65,469 PointsWhat do you get from being a moderator exactly?
I'm just curious.
Tommy Gebru
30,164 PointsOK
"Moderators overlook the entire forum, our main role is all round assistance but I perceive us as mentors as we're chosen not by how well we know code but by our continued dedication to help a fellow student such as yourself. I think I've learned more by being active in the forums than I have the lessons. Short of that, we help by reformatting your markdown language so images, links, or code appear correctly in the forum; or mark answers as best so that it might be helpful for someone else later who comes across that thread. Just generally helpful things."
Alexander Davison
65,469 PointsSure! I'll be happy to help :)
How would a proceed?
Tommy Gebru
30,164 PointsI already recommended you just continue to be awesome
Alexander Davison
65,469 PointsRecommended? Huh?
What do you mean?
Alexander Davison
65,469 PointsHe-llooooooo?????
Tommy Gebru
30,164 PointsHey! Alexander Davison, so a recommendation simply means that I alert treehouse staff, that you would be a good fit, this is done in similar fashion to the "Best Answer" button.
If you would like to know more about Moderators on Treehouse click me
Alexander Davison
65,469 PointsThanks :)
Now I understand.
Tommy Gebru
30,164 PointsTommy Gebru
30,164 PointsHey Alex, what has been your favorite language to work with so far?
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsBy the way why ask?
Just curious.
P.S.: I also like Ruby time-to-time