javascript - Why this code is valid: "(1,eval)('this')" -
why next code valid javascript code?
var global = (1,eval)('this'); alert(global);
that's because comma operator returns second operand (and evaluates both).
the code in question equivalent to:
1; var global = eval('this'); alert(global);
Comments
Post a Comment