Writing DRY JavaScript: A Case Study With Event Listeners

Photo by Markus Spiske on Unsplash

It is often the case that when you need to set one event listener, you need to set many. It is also often the case that for each of those various events, the end action that your program will perform only slightly differs between each unique user behavior. Perhaps there are several buttons or options that could be present on one path but a totally different set that might be present on…