title: Writing compose from scratch, how do parameters get passed down?
body: <p>I was tasked with having to write compose from scratch, here are the requirements:</p>
  <p>Write Compose and Pipe functions.</p>
  <p>Step 1: Implement the function Compose:</p>
  <p>Compose should return a function that is the composition of a list of
  functions of arbitrary length.</p>
  <p>Each function is called on the return value of the function that follows.</p>
  <p>You can view compose as moving right to left through its arguments.</p>
  <p>Compose Example:</p>
  <pre><code>var greet = function(name){ return 'hi: ' + name;}
  var exclaim = function(statement) { return statement.toUpperCase() + '!';}
  var welcome = compose(greet, exclaim);
  welcome('phillip'); // 'hi: PHILLIP!'
  </code></pre>
  <p>I was able to get things working using mainly intuition, here is my solution:</p>
  <pre><code>var compose = function() {
    var args = arguments
    return function(param) {
      var result = param
      for (let i = args.length -1; i &gt;=0; i --) {
        result = args[i](result)
      }
      return result
    }
  
  };
  </code></pre>
  <p>What I don't understand is: How does 'phillip' get passed down to params? Compose doesn't have any way to access it</p>