Is there a difference between window.addEventListener and addEventListener?

3

When I use addEventListener is the same as window.addEventListener or is there a difference?

    
asked by anonymous 03.10.2017 / 16:44

1 answer

6

None, they are the same. It is a window method that is made available in global scope.

All window methods / properties are in global scope and can be accessed via object: window.location.href or directly location.href . There are hundreds ...

    
03.10.2017 / 16:50