My question is quite simple, if I declare an IF statement with a series of OR clauses will JavaScript read all of the ORs or stop at the first one that is satisfied?
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Stops at the first one. It’s called short-circuiting
http://en.wikipedia.org/wiki/Short-circuit_evaluation
https://developer.mozilla.org/en/JavaScript/Reference/Operators/Logical_Operators