You have this function.
function getUserInput(event){
userInput = event.target.value;
return userInput;
}
Why are you mutating a global variable and then returning it? Why not just return the event as is. As far as I can see, you never actually use the global variable, at least not in this file. In any case, you should be able to get the user input at any time from the DOM, so having this kind of function is unnecessary. Avoid accessing or mutating (or even creating, ideally) global variables like this.