Actually, just see (1,eval)('this') vs eval('this') in JavaScript?, which I've now voted as a duplicate:
.. the Ecma spec considers a reference to eval to be a "direct eval call", but an expression that merely yields eval to be an indirect one -- and indirect eval calls are guaranteed to execute in global scope.
(While the following is [mostly] true, it is not specific to eval
usage.)
The comma operator evaluates all the expressions and yields the value of the last expression.
That is, (0, eval)
evaluates to eval
(which is a function-object value), such that the resulting expression is equivalent to eval('this')
.
To see it another way:
var f = (0, eval)
f === eval // true
f('this')