p>

<p>The <code>nextPartialResult</code> closure is called sequentially with an
accumulating value initialized to <code>initialResult</code> and each
element of the sequence. This example shows how to find the sum
of an array of numbers.</p>

<pre><code class="language-swift">let numbers = [1, 2, 3, 4]
let addTwo: (Int, Int) -&gt; Int = { x, y in x + y }
let numberSum = numbers.reduce(0, addTwo)
// &#39;numberSum&#39; == 10</code></pre>

<p>When <code>numbers.reduce(_:_:)</code> is called, the
following st