I just can't figure out why this function can be executed rightly?
what's the truth behind this situation, other ways like IIFE?
I occasionally find that when I using webpack to bundle one ts module, as below screenshot shows
demo code
(0, console.log)("hello world!")
// hello world!
function test(a, b) {
console.log(`a =`, a);
console.log(`b =`, b);
}
(test)(111, 222)
// a = 111
// b = 222
(0, test)(111, 222)
// a = 111
// b = 222
(1, test)(111, 222)
// a = 111
// b = 222
refs
https://en.wikipedia.org/wiki/Immediately-invoked_function_expression