document.addEventListener('DOMContentLoaded', function(e) {
document.addEventListener('scroll', function(e) {
let documentHeight = document.body.scrollHeight;
let currentScroll = window.scrollY + window.innerHeight;
// When the user is [modifier]px from the bottom, fire the event.
let modifier = 200;
if(currentScroll + modifier > documentHeight) {
console.log('You are at the bottom!')
}
})
})