立即执行函数&逗号运算符
-
(0, function() {})()
原理是逗号运算符 -
逗号运算符,会对每个操作数从左到右求职,返回最后一个操作数的值;
console.log(0, 1, 2) // 0,1,2
console.log((0, 1, 2)) // 2
通常用在一些压缩过后的代码里 It’s the comma operator and it’s useful for confusing people.
(0, function() {})()
原理是逗号运算符
逗号运算符,会对每个操作数从左到右求职,返回最后一个操作数的值;
console.log(0, 1, 2) // 0,1,2
console.log((0, 1, 2)) // 2
通常用在一些压缩过后的代码里 It’s the comma operator and it’s useful for confusing people.