Closed AkimotoReiko closed 2 months ago
对于那些只设置了类型、没有初值的顶层属性,有一个细节需要注意。 这个例子中, target 设置为大于等于ES2022,代码的执行结果打印的不是 undefined,但是设置 useDefineForClassFields 为 true 就会打印 undefined,这里的疑问点就是 es2022 好像没生效,另外这一章提到了 tsconfig.json,但是这一章里面没有关于 useDefineForClassFields 的记载
谢谢指出,这个部分完全重写了。
感谢阮老师
对于那些只设置了类型、没有初值的顶层属性,有一个细节需要注意。 这个例子中, target 设置为大于等于ES2022,代码的执行结果打印的不是 undefined,但是设置 useDefineForClassFields 为 true 就会打印 undefined,这里的疑问点就是 es2022 好像没生效,另外这一章提到了 tsconfig.json,但是这一章里面没有关于 useDefineForClassFields 的记载