I'm trying to understand the output of a webpack bundle. Everything looks understandable except the following snippet. I know the ()()
pattern but I would like to know why they put a 0
as first parameter.
(0, _jquery2.default)('<li></li>').text('foo').appendTo(ul);
Doing tests I see that no matter how many params you pass it always will return the last param. so if I do
(0, 'foo', function(arg){console.log(arg)})('bar')
-> bar
It will return bar
.
Why they do this way? Maybe strict mode has to do with this?