title: What does the lodash flow function do?
body: <p>I am reading some code that uses _.flow() from lodash and the explanation in the docs just isn't making sense to me.</p>
  
  <p>The doc says </p>
  
  <blockquote>
    <p>Creates a function that returns the result of invoking the given
    functions with the this binding of the created function, where each
    successive invocation is supplied the return value of the previous.</p>
  </blockquote>
  
  <p>With the example:</p>
  
  <pre><code>function square(n) {
    return n * n;
  }
  
  var addSquare = _.flow([_.add, square]);
  addSquare(1, 2);
  // =&gt; 9
  </code></pre>
  
  <p>I have read this a few times and I can not work out what it means or how that function returns 9. The closest think I can think of is folding in functional programming but this doesn't look like that. Is there any alternative way of explaining what flow does?</p>