How to get count of DOM elements in JavaScript

DOM
By Jad Joubran · 
Last updated Mar 09, 2018
<div class="title"></div>
<div class="title"></div>
const elements = document.querySelectorAll(".title");

const length = elements.length;
2