Skip to content

Instantly share code, notes, and snippets.

@monkyz
Created October 22, 2012 23:04
Show Gist options
  • Save monkyz/3935315 to your computer and use it in GitHub Desktop.
Save monkyz/3935315 to your computer and use it in GitHub Desktop.
javascript boolean logic
// => 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