title: Equivalent of "element.scrollHeight" for "window" in Javascript?
body: <p>What's the equivalent to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element.scrollHeight" rel="noreferrer"><code>element.scrollHeight</code></a> for <code>window</code> in plain vanilla Javascript? I'm trying to rewrite code to target <code>window</code> or <code>document</code> instead of the <code>element</code>?</p>
  
  <p><strong>Converting this:</strong>
  <code>remaining = element.scrollHeight - (element.clientHeight + element.scrollTop);</code></p>
  
  <p><strong>Into this:</strong>
  <code>remaining = window.scrollHeight - (window.innerHeight + window.pageYOffset);</code></p>