title: Angular Typescript type ERROR when using Array.reduce()
body: <p>let say I have two arrays of typed object (same type), and I want to merge them, checking if an object already exists, then sum the old and new amount and return a new array with updated values</p>
  
  <p><strong>model</strong>: </p>
  
  <pre><code>class Ingredient {
    constructor(public name: string, public amount: number){ }
  }
  </code></pre>
  
  <p><strong>arrays</strong>: </p>
  
  <pre><code>  private ingredients: Ingredient[] = [
      new Ingredient('farina', 500),
      new Ingredient('burro', 80),
      new Ingredient('uccellini', 5)
    ];
  
    private newIngredients: Ingredient[] = [
      new Ingredient('uova', 5),
      new Ingredient('pancetta', 80),
      new Ingredient('uccellini', 8)
    ];
  </code></pre>
  
  <p>when I try to create a <strong>method</strong> to check and merge arrays, I have an ERROR logged before to start writing my code!:</p>
  
  <pre><code>addIngredients(newIngredients: Ingredient[]) {
  
    this.ingredients
      .concat(this.newIngredients)
      .reduce((result, curr) =&gt; {
  
      });
  }
  </code></pre>
  
  <p>This is the <strong>error</strong>: </p>
  
  <pre><code>error TS2345: Argument of type '(result: Ingredient, curr: Ingredient) =&gt; 
  void' is not assignable to parameter of type 
  '(previousValue: Ingredient, currentValue: Ingredient, currentIndex: number, array: Ingredient[]) ...'.
  Type 'void' is not assignable to type 'Ingredient'.
  </code></pre>
  
  <p>I cannot move on, please help me!</p>