title: pad javascript array with value until length is evenly divisible by three
body: <p>I am given a number of arrays of varying length.  I'd like to pad these arrays (value of padding element can be <code>0</code>)  so that the length is evenly divisible by three (I need to create three subarrays of equal length for each array i'm given).</p>
  
  <p>Here's my intended, unsuccessful code with a while loop and an array <code>push</code> that should increment <code>len</code> until <code>len % 3 === 0</code>:</p>
  
  <pre><code>function fillArray(value, arr) {
    var len = arr.length;
    while (len % 3 !== 0) {
      arr.push(value);
    }
    return arr;
  }
  </code></pre>
  
  <p>For example, if given an array as follows</p>
  
  <pre><code>[1,2,3,4,5,6,7,8,9,10]
  </code></pre>
  
  <p>I'll want to pad (with <code>0</code>) until the length is divisible by three:</p>
  
  <pre><code>[1,2,3,4,5,6,7,8,9,10,0,0]
  </code></pre>
  
  <p>thanks for your help.</p>