going to end in page in js code example
Example 1: automatically scroll to bottom of page
window.scrollTo(0,document.body.scrollHeight);
Example 2: javascript auto scroll on bottom
const scrollToTop = () => {
const scrollTopButton = document.getElementById('scrollTopButton');
scrollTopButton.addEventListener('click', () => {
window.scrollTo(0, document.body.scrollHeight);
});
};