Created
October 1, 2019 19:11
-
-
Save gusmcnair/06f9a94d8b1dc54f5eed89b627c06dee to your computer and use it in GitHub Desktop.
Application logic drills
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
Traffic lights drill | |
function doTrafficLights() { | |
const activeLight = getActiveLight(); | |
if (activeLight === "red"){ | |
turnRed(); | |
} | |
else if (activeLight === "yellow"){ | |
turnYellow(); | |
} | |
else { | |
turnGreen(); | |
} | |
} | |
Error alert drill | |
function main() { | |
try { doAllTheThings(); | |
} catch(error){ | |
const e = error; | |
console.error; | |
reportError(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment