title: Shortest way to get last element by class name in javascript
body: <p>I know that by using <code>jQuery</code> you can easily use <code>:last</code> selector to get the last element.</p>
  <pre><code>$(&quot;.some-element:last&quot;)
  </code></pre>
  <p>Although, this does <strong>not</strong> work with javascript.</p>
  <pre><code>document.querySelectorAll(&quot;.some-element:last&quot;)
  </code></pre>
  <p>What would be the best and shortest way to do the same thing in <code>javascript</code>?</p>