Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 566 Bytes

,运算符.md

File metadata and controls

16 lines (13 loc) · 566 Bytes

https://stackoverflow.com/questions/40967162/what-is-the-meaning-of-this-code-0-function-in-javascript

https://stackoverflow.com/questions/9107240/1-evalthis-vs-evalthis-in-javascript

https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Comma_Operator

(function() {
  (0,eval)("var foo = 123"); // indirect call to eval, creates global variable
})();
console.log(foo);            // 123
(function() {
  eval("var bar = 123");     // direct call to eval, creates local variable
})();
console.log(bar);            // ReferenceError