title: javascript fold reduce functional programming
body: <p>In Javascript there is reduce function which takes function and array, map over the array and return whatever the function return.</p>
  
  <p>For example:</p>
  
  <pre><code>[1, 2, 3].reduce(function(acc, x) {
    acc += x 
    return acc;
  }, 0); // 6 
  </code></pre>
  
  <p>In Haskell there is fold which for me do the same:</p>
  
  <pre><code>foldl (+) 0 [1,2,3]  -&gt; 6
  </code></pre>
  
  <p>If i want to create that kind of function as library is it safe to call it   fold instead of reduce and is there any difference between the two. </p>
  
  <p>Does both functions the same except the name or there is some difference</p>
  
  <p>I demostrate with different languages because Js doesnt have foldl function.</p>
  
  <p>Thanks</p>