JavaScript getBoundingClientRect() vs offsetHeight while calculate element height : <p>What is the best way to get element height:</p>

<pre><code>var myElement = document.querySelector('.some-class');

var height = myElement.getBoundingClientRect().height;
</code></pre>

<p>or</p>

<pre><code>var myElement = document.querySelector('.some-class');

var height = myElement.offsetHeight;  
</code></pre>
