title: Javascript refactor map example to use reduce
body: <p>As an exercise I'm trying to convert a map example to use reduce:</p>
  
  <pre><code>const numbers = [1, 2, 3, 4];
  
  numbers.map(function(a,b) {
      return a+b;
  });
  // [1, 3, 5, 7]
  </code></pre>
  
  <p>my attempt for same example with reduce:</p>
  
  <pre><code>numbers.reduce(
    (sum, elem) =&gt; {
      sum.push(elem + elem); // how can one add the index of array to the number instead of doubling it?
      return sum;
    }, []);
  // [2, 4, 6, 8], instead I want: [1, 3, 5, 7]
  </code></pre>