title: Get the ID's of all the elements in the array
body: <p>I want to get all the elements that are having an ID and want to store that id value in an array and I am using the following method:</p>
  
  <pre><code>var allTheElementsHavingID = document.querySelectorAll('[id]');
  var allTheID = [];
  for(i=0;i&lt;allTheElementsHavingID.length;i++)
  {
    allTheID.push(allTheElementsHavingID[i].id);
  }
  </code></pre>
  
  <p>But the problem here is that I am having around 15000 elements with an ID.
  and when I run the code in console it freezes the browser.
  so I want the alternative of the for loop here so as to store all the ID's
  <strong>Is there any other method??</strong> that will prove more efficient</p>