1 | 1eN N表示多少个0 |
函数调用也可以用二元表达式简写
简化前:
1 | `function x() { console.log("x");}function y() { console.log("y");}let z = 3;if (z == 3) { x();} else { y();}` |
简化后:
1 | `function x() { console.log("x");}function y() { console.log("y");}let z = 3;(z == 3 ? x : y)();` |
参考: