本文介绍了Node.js支持=> (箭头功能)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Node.js是否支持=>函数关键字别名?如果是,从哪个版本开始?如何启用此语言扩展?

Is Node.js supporting => function keyword alias already? If yes, starting from which version? How to enable this language extension?

(function() { console.log('it works!') })()

成为

(() => { console.log('it works!') })()


推荐答案

您可以关注此问题:

目前(截至02.05.2014)已实施箭头功能并等到此功能将在第8版中登陆:

Currently (as 02.05.2014) arrow functions have been implemented and waiting until this functionality will be landed in v8: https://codereview.chromium.org/160073006/

之后我们需要等待,直到带有箭头功能的v8版本被集成到Node.JS中。您可以在那里关注Node.JS更改日志:(搜索v8:升级到....)

After then we'll need to wait, until v8 version with arrow function would be integrated into Node.JS. You can follow Node.JS changelog there: https://github.com/joyent/node/blob/master/ChangeLog (search for "v8: upgrade to ....")

这篇关于Node.js支持=> (箭头功能)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 12:48