【问题标题】:Is it necessary to use strict when using certain es6 methods in Node.js [duplicate]在 Node.js 中使用某些 es6 方法时是否需要使用 strict [重复]
【发布时间】:2016-12-24 14:47:36
【问题描述】:

我们在我的工作中进行了辩论,有人说在使用 es6 和 nodejs 时,当然没有 babel,你应该总是添加 'use strict' ,因为某些 es6 方法可能不起作用。我找不到支持这一点的文档,是真的吗?

【问题讨论】:

  • 您是在询问是否默认启用严格模式,还是因为您使用的是 es6?不,不是。
  • 已回复 herehere

标签: javascript node.js use-strict


【解决方案1】:

根据规范:

模块代码始终是严格模式代码。

http://www.ecma-international.org/ecma-262/6.0/#sec-strict-mode-code

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-01-17
    • 1970-01-01
    • 1970-01-01
    • 2016-10-29
    • 2015-11-05
    • 2017-09-28
    • 1970-01-01
    相关资源
    最近更新 更多