I know about self-invoking JavaScript functions made famous by jQuery:
( function(x){ console.log(x);})('Hello World');
logs Hello World.
I recently came across a code where the author uses 0 within the main parentheses and before the function.
example:
(0, function(x){ console.log(x);})('Hello World');
This will work and log 'Hello World' but I was curious to know what is point of the parameter (in this case 0) before the function? what is the use case for it?
In the case i saw the function was in variable:
f = function(x){ console.log(x);};
(0, f)('Hello World');