title: Return the sum of the array with decimal numbers JavaScript
body: <p>I have a function that takes the array of score and needs to calculate the average score. This works with regular numbers, but doesn't work when the score number has a decimal. How do I change this function to solve this? We don't want to cut the decimals of course.</p>
  
  <pre><code>const score = [ "3.0", "3.2", "4.4" ]
  
  const result = (survey
          .map( function(i){ // assure the value can be converted into an integer
          return /^\d+$/.test(i) ? parseInt(i) : 0; 
        })
        .reduce( function(a,b){ // sum all resulting numbers
          return (a+b) 
        })/score.length).toFixed(1)
  </code></pre>