Created
December 28, 2017 20:09
-
-
Save crystalattice/7966f2a8d8e71dd3c71c2d8849a61453 to your computer and use it in GitHub Desktop.
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
//Traffic Light | |
function doTrafficLights() { | |
var activeLight = getActiveLight(); | |
if (activeLight === "red"){ | |
turnRed();} | |
else if (activeLight === "yellow"){ | |
turnYellow();} | |
else if (activeLight === "green"){ | |
turnGreen();} | |
} | |
//Error | |
function main() { | |
try { | |
doAllTheThings();} | |
catch(e) { | |
console.error(e); | |
reportError(e);} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment