How to listen to scroll event in JavaScript

DOM
Last updated Nov 05, 2018
window.addEventListener("scroll", event => {
  console.log("Window scrolled", event);
});