Skip to content

Instantly share code, notes, and snippets.

@jamessergeant
Created August 9, 2017 10:44
Show Gist options
  • Save jamessergeant/54e333e17d959b00e07c896b67afc6a7 to your computer and use it in GitHub Desktop.
Save jamessergeant/54e333e17d959b00e07c896b67afc6a7 to your computer and use it in GitHub Desktop.
function doTrafficLights() {
var activeLight = getActiveLight();
if (activeLight === 'red') {
turnRed();
} else if (activeLight === 'yellow') {
turnYellow();
} else if (activeLight === 'green') {
turnGreen();
}
}
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