我应该在 ionic 2 / angular 2 / ECMAScript 5 中设置 "use strict;"
Should I set "use strict;" in ionic 2 / angular 2 / ECMAScript 5
刚开始一个 ionic 2 / angular 2 / ECMAScript 5 项目。
也许这是一个愚蠢的问题,但你有什么建议,我还应该添加 "use strict";到我的代码?
我浏览了一些 ionic 2 或 angular 2 示例,但没有看到 "use strict;" 仍在使用。
The "use strict" Directive The "use strict" directive is new in
JavaScript 1.8.5 (ECMAScript version 5).
It is not a statement, but a literal expression, ignored by earlier
versions of JavaScript.
The purpose of "use strict" is to indicate that the code should be
executed in "strict mode".
With strict mode, you can not, for example, use undeclared variables.
如果您当时使用 Typescript 编写,不 - 不要使用它。
刚开始一个 ionic 2 / angular 2 / ECMAScript 5 项目。
也许这是一个愚蠢的问题,但你有什么建议,我还应该添加 "use strict";到我的代码?
我浏览了一些 ionic 2 或 angular 2 示例,但没有看到 "use strict;" 仍在使用。
The "use strict" Directive The "use strict" directive is new in JavaScript 1.8.5 (ECMAScript version 5).
It is not a statement, but a literal expression, ignored by earlier versions of JavaScript.
The purpose of "use strict" is to indicate that the code should be executed in "strict mode".
With strict mode, you can not, for example, use undeclared variables.
如果您当时使用 Typescript 编写,不 - 不要使用它。