I need to detect if a user is scrolled to the bottom of a page. If they are at the bottom of the page, when I add new content to the bottom, I will automatically scroll them
You can check if the combined result of the window's height and scroll top is bigger than that of the body
if (window.innerHeight + window.scrollY >= document.body.scrollHeight) {}