In Javascript, sometimes a function is bound to an object. Within this function the object is represented with this
.
In some cases you want to remove the reference to this
when you execute or pass the function.
In this case, the following syntax disassociates the function from the object:
(0, obj.func)(params)
Example:
"use strict"; // removes 'Window'-object as value of this in the global scope.
function func () {
console.log(this);
}
const obj = {}
obj.func = func;
obj.func(); // returns obj
(0, obj.func)(); // returns <undefined>