title: Determining when scrolled to bottom of a page with Javascript
body: <p>I'm trying to determine when I've scrolled to the bottom of the page (without using any JS library), but so far, I'm a bit confused over which one of the following to use.  The most promising one I've seen is <code>window.scrollY</code>, but even when scrolled to the bottom of the page, it never matches the value of <code>window.innerHeight</code>.  What's the best way to do this?</p>
  
  <pre><code>window.innerWidth
  window.innerHeight
  
  window.outerWidth
  window.outerHeight
  
  window.scrollX
  window.scrollY
  
  document.body.scrollWidth
  document.body.scrollHeight
  document.body.scrollTop
  document.body.scrollLeft
  
  document.body.offsetTop
  document.body.offsetLeft
  document.body.offsetWidth
  document.body.offsetHeight
  </code></pre>