title: sum(2)(3) and sum(2, 3) what is the common solution for both
body: <p>I was asked this question in an interview.</p>
  
  <p>for <code>sum(2)(3)</code> in currying style</p>
  
  <pre class="lang-js prettyprint-override"><code>sum(a) {
    return (b) {
      return a + b;
    }
  }
  </code></pre>
  
  <p>for sum (2, 3)</p>
  
  <pre class="lang-js prettyprint-override"><code>sum(a, b) {
    return a + b;
  }
  </code></pre>
  
  <p>Is there any common function which can work for both</p>