When I use addEventListener
is the same as window.addEventListener
or is there a difference?
When I use addEventListener
is the same as window.addEventListener
or is there a difference?
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 ...