title: JS Function With Two Parentheses and Two Params
body: <p>I'm trying to understand how a function works that is run with two parentheses and two parameters. Like so:</p>
  
  <pre><code>add(10)(10); // returns 20
  </code></pre>
  
  <p>I know how to write one that takes two params like so:</p>
  
  <pre><code>function add(a, b) {
    return a + b;
  }
  
  add(10,10); // returns 20
  </code></pre>
  
  <p>How could I alter that function so it could be run with one set of parameters, or two, and produce the same result?</p>
  
  <p>Any help is appreciated. Literally scratching my head over this.</p>
  
  <p>Thanks in advance!</p>