84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
Two files in the same directory a.ts b.ts
a.ts:
const a=1;
b.ts:
const a=2;
The two files have no dependencies, I really can’t figure it out
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
Because there is no import or export in your two files, so he thinks that your two files are global... and will naturally prompt this
import
export
Because there is no closure in the file, each a is a global variable by default. You can use export to export a, then a becomes a variable in the closure.
Because there is no
import
orexport
in your two files, so he thinks that your two files are global... and will naturally prompt thisBecause there is no closure in the file, each a is a global variable by default. You can use export to export a, then a becomes a variable in the closure.