title: Splitting an array of strings to an array of floats in JavaScript
body: <p>I am trying to split an array of strings, called 'vertices' and store it as an array of floats.</p>
  
  <p>Currently the array of strings contains three elemets: <code>["0 1 0", "1 -1 0", '-1 -1 0"]</code> </p>
  
  <p>What I need is an array of floats containing all these digits as individual elements: <code>[0, 1, 0, 1, -1, 0, -1, -1, 0]</code></p>
  
  <p>I used the split() function as follows:</p>
  
  <pre><code>for(y = 0; y &lt; vertices.length; y++)
  {
      vertices[y] = vertices[y].split(" "); 
  }
  </code></pre>
  
  <p>...which gives me what looks to be what I am after except it is still made up of three arrays of strings.</p>
  
  <p>How might I use parseFloat() with split() to ensure all elements are separate and of type float?</p>