Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. //Traffic lights drill
  2.  
  3. function doTrafficLights() {
  4. const activeLight = getActiveLight();
  5. if(activeLight === 'red') {
  6. turnRed();
  7. } else if(activeLight === 'green') {
  8. turnGreen();
  9. } else {
  10. turnYellow();
  11. }
  12. };
  13.  
  14. //Error alert drill
  15.  
  16. function main() {
  17. try {
  18. doAllTheThings();
  19. } catch(err) {
  20. console.error(err);
  21. reportError(err);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement