What does js function (parameter, parameter) (parameter, parameter) mean

  javascript, question

The following figure: I really don’t understand what this means. . .

Take a few steps to see

The first isComma operator

The general use is to evaluate from left to right and then return the last value

(0, 1) // 1
 (0, {}) // {}
 (0, function () {}) // function () {}

Then you need to look at the following example:

const _utils = {
 func: function () {
 console.log(this === window)
 _utils.func();  // false
 let func = _utils.func
 func() //true
 (0, _utils.func)();  // true

Direct execution_utils.func()The inside of the functionThisPointed to_utils;
When the handle_utils.funcWhen assigning to a variable, the functionThisWill point to this variableWhere?The scope of, namely:

Let b = {a: func} // func is 'letfunc = _ utils.func' in the above fragment.
 B.a() // this inside the function points to b at this time

And(0, _utils.func)The effect is similar to that oflet func = _utils.funcIt’s about the same, but promise_utils.funcAnonymous function’sThis CertainWill be pointed atWindowFor example:

const c = {
 a: function () {
 (0, _utils.func)()
 c.a() // true

so(0, Anonymous function) (Function Call Parameter)The writing of the is to ensure that the function is inWindowExecute under scope.