1 person found this helpful
a. The event throws an argument to the function, the argument carries information about the event. This information can be very useful at times. One common use is that the same function can be used for several items, and you cab use the event.currentTarget to isolate which object was involved.
b. I do not have the definitive answer, but it probably has to do with the event listener method using the function name in its processing, packing in the argument data before it commands the function to execute. Using the function with the parentheses might actually call the function, and it isn't ready to go anywhere without a fully defined argument added in.
a) yea it can be useful. but without this parameter, the addEventListener function wont even work!
but that's fine, I guess I just have to do what has to be done.
That's correct--if you don't define the function properly it will not work... if an argument is going to be sent to a function and the function is not set up to receive it, the compiler will throw an error.