Created
May 14, 2014 21:10
-
-
Save carlosrojaso/7f1f6f021bd6cfd46b17 to your computer and use it in GitHub Desktop.
JS Logical
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
// Do something with foo if foo is truthy. | |
foo && doSomething( foo ); | |
// Set bar to baz if baz is truthy; | |
// otherwise, set it to the return value of createBar() | |
var bar = baz || createBar(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment