title: Array Methods in javascripts
body: <p>I don't understand this method of <code>pop</code> and <code>unshift</code> in this array</p>
  <pre class="lang-js prettyprint-override"><code>let nums = [1, 2, 3, 6, 9, 8, 7, 4];
  const ids = [1, 2, 3, 6, 9, 8, 7, 4];
  
  let btn5 = document.getElementById(&quot;btn5&quot;);
  
  btn5.onclick = function() {
    nums.unshift(nums.pop());
  
    for (i = 0; i &lt;= 7; i++) {
      document.getElementById(&quot;btn&quot; + ids[i]).innerHTML = nums[i];
    }
  }
  </code></pre>