I was working on my podcast app and encountered an error that was more exciting than any previous error so far:
Running the code, I found out that when I updated the function after passing it, it was never updated in the event handler! This seems more like the problem is that the event handler takes a function passed by value rather than passed as a reference. I looked it up and how JavaScript handles event listeners is: once you supply the function to the event handler, it's set in stone - updating the function doesn't update it in the event listener. Good to know!