title: Convert Fraction String to Decimal?
body: <p>I'm trying to create a javascript function that can take a fraction input string such as <code>'3/2'</code> and convert it to decimal—either as a string <code>'1.5'</code> or number <code>1.5</code></p>
  
  <pre><code>function ratio(fraction) {
      var fraction = (fraction !== undefined) ? fraction : '1/1',
      decimal = ??????????;
      return decimal;
  });
  </code></pre>
  
  <p>Is there a way to do this?</p>