Open aidanbell opened 4 years ago
This occurs a lot in the app. We want to try to keep our code as "DRY" as possible, which means that we want to encapsulate a lot of the same functionality into reusable functions. This will really reduce the overall amount of code and make it easier to manage.
https://github.com/JustinLogue/project1/blob/acd8c29b4b337027dbf15db2e89a5c44168b16d3/script.js#L662-L679 Your event listener functions are almost identical. Remember that you can define/declare a function, and pass it into the event listener as the call back. This could help you cut down on a lot of lines of code.
For example: