JavaScript JavaScript and the DOM Responding to User Interaction Listening for Events with addEventListener()

Zachary Smith
Zachary Smith
Full Stack JavaScript Techdegree Student 9,466 Points

In "addEventListener('mouseover', (), why are the parentheses empty before the arrow function?

Sorry in advance if this is a ridiculous question but I've understood everything up until now. I did the practice on arrow functions and I thought I understood them but I guess I am struggling to apply their use to methods, particularly the addEventListener method. So what are the first empty set of () supposed to mean? Is this what Guil was referring to as an anonymous function? Thanks in advance.

2 Answers

Steven Parker
Steven Parker
201,999 Points

The empty parentheses indicate that the function takes no argument(s), and are required by the syntax.

Arrow function expressions are also anonymous, whether they take arguments or not. That just means they don't have a specific name.