title: ES6 pass function as parameter example
body: <p>I don't know JS/ES6 well enough to describe my question in code. So most of this question is conceptually and in pseudo code. </p>
  
  <p>Say I have a <code>Contractor</code> class like this:</p>
  
  <pre><code>class Contractor {
   constructor(jobFn) {
      // save jobFn;
    }
  
    dailyRoutine() {
      // let result = DriveToWork()
      const result = 6
      DoTheJob(result)
      DriveBackHome()
    }
  
  }
  </code></pre>
  
  <p>The problem is, what the <code>DoTheJob()</code> does might be different things in different places. </p>
  
  <p>So in place A, it could be</p>
  
  <pre><code>he = new Contractor(write_front_end(with, this, and that))
  </code></pre>
  
  <p>And in place B, it could be</p>
  
  <pre><code>he = new Contractor(fix_backend_node(with, express))
  </code></pre>
  
  <p>I.e., the behavior need to be passed in during the constructor, and the action might need to take different kind and different amount of parameters. </p>
  
  <p>Would such thing be possible with ES6?<br>
  Please show ES6 code that can pass function with different kind and different amount of parameters through the constructor to <code>DoTheJob()</code>.</p>
  
  <p>Further, the challenge is that the <code>jobFn</code> need to be a <strong><em>Curried</em></strong> function, meaning there is one or more parameter missing to do the <code>DoTheJob</code> job. Say if the <code>jobFn</code> is passed with <em>Curried</em> <code>add(3)</code>, then <code>DoTheJob</code> will do UncurriedAdd of <code>add(3, 6)</code>; if then <code>jobFn</code> is passed with <em>Curried</em> <code>multiple(5)</code>, then <code>DoTheJob</code> will do Uncurried of <code>multiple(5, 6)</code>;</p>