Node.js是否支持let关键字? [英] Does Node.js support let keyword?
问题描述
在Javascript 1.7中, let
关键字引入了块范围。这可以说是Javascript最需要的功能,我想知道Node.js是否支持它。
In Javascript 1.7 the let
keyword introduces block scope. This is arguably the most needed feature of Javascript and I was wondering if Node.js supports it.
部分难以确定这是Node运行Google的V8引擎,来自这样的标准,我不知道这些是如何与Javascript xy版本号对齐的。
Part of my difficult in ascertaining this is Node runs Google's V8 engine, which comes from such and such standard and I don't know how these line up with the Javascript x.y version numbers.
推荐答案
是的,如果您使用 - harmony
标志运行Node,则支持 let
关键字。但是,我不建议在生产软件中使用 let
。 (顺便说一下,在你提出新问题之前,你可以通过搜索找到这个答案)
Yes, the let
keyword is supported, provided you run Node with the --harmony
flag. However, I wouldn't recommend using let
in production software. (by the way, you could have found this answer via search, before you asked a new question)
这篇关于Node.js是否支持let关键字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!