Skip to content

Instantly share code, notes, and snippets.

@crystalattice
Created December 28, 2017 20:09
Show Gist options
  • Save crystalattice/7966f2a8d8e71dd3c71c2d8849a61453 to your computer and use it in GitHub Desktop.
Save crystalattice/7966f2a8d8e71dd3c71c2d8849a61453 to your computer and use it in GitHub Desktop.
//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