title: String with Comma separated numbers to array of integer in javascript
body: <p>I am converting String with Comma separated numbers to a array of integer like,</p>
  
  <pre><code> var string = "1,2,3,4"; 
   var array = string.replace(/, +/g, ",").split(",").map(Number); 
  </code></pre>
  
  <p>it returns <code>array = [1,2,3,4];</code></p>
  
  <p>But when ,</p>
  
  <pre><code> var string = ""; 
   var array = string.replace(/, +/g, ",").split(",").map(Number); 
  </code></pre>
  
  <p>it returns <code>array = [0];</code></p>
  
  <p>I was expecting it to return <code>array = [];</code>
  can someone say why this is happening.</p>