fu()和(0,fu)()有什么区别
1 | import { a } from 'b'; |
babel转成以下代码:
1 | 'use strict'; |
(0, _b.a)() ensures that the function _b.a is called with this set to the global object (or if strict mode is enabled, to undefined).
(0, _b.a)()
确保 function _b.a
this 绑定到当前全局变量,如果是在严格模式,则绑定到undefined
。 如果你直接使用_b.a
,则this
指向的是_b