title: How to make this function call add(4)(5)(6) work? which will return 15
body: <p>I know one way is there any other way to make this type of function call and get the correct addition.</p>
  <p>My answer:</p>
  <pre><code>function add(x) {
  
    return function(y) {
    
      return function(z) {
      
        return x + y + z
      }
    }
  
  }
  
  add(4)(5)(6)
  </code></pre>
  <p>It means that the first function returns another function and then that returned function is called immediately then that function returns another function which is then called immediately which will give us the final answer.</p>