I recently finished the Animal Fun Facts project. I got stuck for a long time because displayFacts would not work when assigned, and I eventually found that it was because of my function definition. I had initially defined it as an arrow function as follows:
const displayFacts = e => {...};
Eventually I corrected it to:
function displayFacts(e) = {...}
This seemed to fix it, which leads me to my question.
Why did this not work with an arrow function?
My first guess is that e.target.alt fails in the same way that the “this” keyword works differently in arrow functions, but I’m really not sure, and googling didn’t help very much.