title: Replacing month name with number
body: <p>So far i have changed the date format from "24 Feb 2014" to "Feb-24-2014" using:</p>
  
  <pre><code>    var dateStart = date;
      var arr = dateStart.split(' ');
      console.log(arr[1]+"-"+arr[0]+"-"+arr[2]);
  </code></pre>
  
  <p>How would I extract the month from arr[1] and replace its equivalent numerical value?</p>
  
  <p>(WHAT i'VE TRIED: I've created an array and an each function to loop through this array and return the month names values (i.e, 2 from Feb, 5 from May)).</p>
  
  <p>ANSWER: The bit that I was looking for specifically in my case was creating the split "arr[1]" as an indexer for the dateArray:</p>
  
  <pre><code>dateArray[arr[1]]
  </code></pre>