Javascript: What is the benefit of two sets of parentheses after function call <p>I understand that in Javascript a function can return another function and it can be called immediately. But I don't understand the reason to do this. Can someone please explain the reason and benefit why you might want to do this in your code? Also, is the function that returns 'hello' considered a closure? </p> <pre><code>function a () { return function () { console.log('hello'); } } //then calling the function a()(); </code></pre>