Created
November 19, 2014 23:07
-
-
Save lolptdr/1b03ee0049298cfe15fb to your computer and use it in GitHub Desktop.
short circuit examples - gilbert
This file contains 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
// Short-circuit examples | |
var one = 10 || 20 | |
console.log("1.", one) | |
var two = false || 30 | |
console.log("2.", two) | |
var three = true || 40 || 50 | |
console.log("3.", three) | |
var four = true || auagoduoracehuroeu | |
console.log("4.", four) | |
var five = { random: 'stuff' } || icaeougude | |
console.log("5.", five) | |
// This throws an error: | |
// var six = false || uaoeuo || true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment