From 43488eeaea6d5e4199540afe0ffa1c7bc25b4d63 Mon Sep 17 00:00:00 2001
From: Ryan Sobol <contact@ryansobol.com>
Date: Fri, 11 Nov 2016 10:17:14 -0800
Subject: [PATCH] Improve the solution

---
 index.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/index.js b/index.js
index e181a66..0ede79e 100644
--- a/index.js
+++ b/index.js
@@ -12,6 +12,15 @@
   // part 1
   stopButton.addEventListener('click', () => {
     stopLight.classList.toggle('stop');
+
+    // or...
+    // if (stopLight.classList.contains('stop')) {
+    //   stopLight.classList.remove('stop');
+    // }
+    // else {
+    //   stopLight.classList.add('stop');
+    // }
+
   });
 
   slowButton.addEventListener('click', () => {
@@ -51,6 +60,14 @@
 
     if (event.target === stopButton) {
       status = stopLight.classList.contains('stop') ? 'on' : 'off';
+
+      // or...
+      // if (stopLight.classList.contains('stop')) {
+      //   status = 'on';
+      // }
+      // else {
+      //   status = 'off';
+      // }
     }
     else if (event.target === slowButton) {
       status = slowLight.classList.contains('slow') ? 'on' : 'off';