title: jquery convert num string to int
body: <p>How can I take a sting containing numbers such as </p>
  
  <blockquote>
    <p>1 - 2 - 3 - 4 - 5 - 6</p>
  </blockquote>
  
  <p>and convert each number into a integer?</p>
  
  <p>I have tried the following, but it just returns the first integer.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var a = '1 - 2 - 3 - 4 - 5 - 6';
  var b = parseInt( a.split('-') );
  
  $('#b').append(b);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id='b'&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>