title: How to convert all elements in an array to integer in JavaScript?
body: <p>I am getting an array after some manipulation. I need to convert all array values as integers.</p>
  
  <p><strong>My sample code</strong></p>
  
  <pre><code>var result_string = 'a,b,c,d|1,2,3,4';
  result = result_string.split("|");
  alpha = result[0];
  count = result[1];
  // console.log(alpha);
  // console.log(count);
  count_array = count.split(",");
  </code></pre>
  
  <p><code>count_array</code> now contains <code>1,2,3,4</code> but I need these value to be in integers.</p>
  
  <p>I had used <code>parseInt(count_array);</code>, but it fails. JS considers each value in this array as string.</p>