window.document.addEventListener = function(event) {...}
window.addEventListener = function(event) {...}
What is the difference between these two lines of code? I get that this window and the document object are two different objects with different properties, and this site provides a good visual guide to the difference. However, I see no difference between what these two lines of code do.
To clarify: what is the difference in doing something like this:
window.addEventListener('mousemove', function (event) {...});
and do something like this window.document.addEventListener('mousemove', function (event) {...});
?
source
share