The task is to return true if the bottom of the page is visible. We can achieve this by simply using the height of the window and the height of the scrolled window.
- Here we will first create a function that will be called whenever you use the scroll.
- Now we will check whether the bottom is visible each time when the function is called using the window height and the scrolled window height.
- And we stored the result inside the flag variable and printed it onto the console.