title: Split a string, at every nth position, with JavaScript?
body: <p>I have the following string:</p>
  
  <pre><code>foofaafoofaafoofaafoofaafoofaa
  </code></pre>
  
  <p>An array with 10 rows (if I split by every 3rd character, that is), which looks something like this, if I were to instantiate it:</p>
  
  <pre><code>var fooarray = new Array ('foo', 'faa', 'foo', 'faa', 'foo', 'faa', 'foo', 'faa', 'foo', 'faa');
  </code></pre>
  
  <p>So I want a function, either built-in or custom-made, which can help me split up a string by every nth character.</p>