title: Reduce the size/length of an array to a certain size/length
body: <p>I have an array: <code>var array = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']</code><br>
  I want the array to be a length of 3, but I don't want to remove the consecutive elements. I want to remove elements evenly from an array.  </p>
  
  <p>Since <code>array.length</code> is 9, I want to remove 6 elements from it and I always want to keep the first element. so in this case, <code>var array</code> would be like <code>['a', 'e', 'i']</code>   </p>
  
  <p>I was doing like this so far:  </p>
  
  <pre><code>var extraLength = array.length - 3;
  var eachVal = Math.round(array.length/extraLength);
  
  for (var j = 0; j &lt; extraLength; j++){
    for(var i = array.length -1; i &gt;= 0; i-- ) {
      if (i == eachVal*j &amp;&amp; i != 0) {
        array.splice(i, 1)
      }
    }
  }
  </code></pre>
  
  <p>This gives an error saying <code>array.splice is not a function</code>. </p>
  
  <p>Also, as I write this, I realized that this only works when <code>array.length/extraLength</code> is an even number, so in the example above, it does not work.</p>
  
  <p>How can I achieve this?</p>