title: what is difference between $('body').height() ,$('window').height() , $('document').height()
body: <p>I am looking at the code written by someone else. In this a class is added of removed when we reach a particular section.I cannot understand the use of $('body').height() here</p>
  <pre><code>if($('#impact_calculator'). length){
          $(window).scroll(function () {
          var scroll = $(window).scrollTop();
          // var box = $('#impact_calculator').offset().top -190;
          var box = $('body').height() - $('#impact_calculator').height() - 450;
          if (scroll &gt;= box) {
              setTimeout(() =&gt; {
              $(&quot;body&quot;).addClass(&quot;sticky&quot;);
              }, 500);
          } else {
              setTimeout(() =&gt; {
                  $(&quot;body&quot;).removeClass(&quot;sticky&quot;);
              }, 500);
          }
  
      });
  </code></pre>