nitialValue;
for (E element in this) {
  value = combine(value, element);
}
return value;
</code></pre>
<p>Example of calculating the sum of an iterable:</p>
<pre class="language-dart"><code>iterable.fold(0, (prev, element) =&gt; prev + element);
</code></pre>
    </section>
    
    <section class="summary source-code" id="source">
      <h2><span>Implementation</span></h2>
      <pre class="language-dart"><code class="language-dart">T fold&lt;T&gt;(T initialValue, T combine(T previousValue, E element)) {
