Created
October 22, 2012 23:04
-
-
Save monkyz/3935315 to your computer and use it in GitHub Desktop.
javascript boolean logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// => means:"evaluates into" | |
true && true => true; | |
true && false => false; | |
false && true => false; | |
false && false => false | |
----------------------------------------------------------------------------------------------------------- | |
false || false => false; | |
true || false => true; | |
false || true => true; | |
true || true => true | |
----------------------------------------------------------------------------------------------------------- | |
a && b || c | |
is the same as | |
(a && b) || c | |
------------------------------------------------ | |
a || b && c | |
is the same as | |
a || (b && c) | |
------------------------------------------------ | |
more info to dig | |
http://es5.github.com/#x11.11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment