Arrow functions not working in node --harmony under Ubuntu

前端 未结 2 879
忘了有多久
忘了有多久 2021-01-04 05:12

I\'m trying to use arrow functions in node v0.10.33 under Ubuntu 14.04 (I\'m running node with --harmony flag), but I\'m getting this

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-04 05:27

    Node, even with the harmony flag, doesn't support the fat arrow yet. Source.

    Edit: Fun little fact, ES6 support is one of the reasons Node got forked into io.js. Check out their page on ES6 features - they provide a flag for the arrow functions, but discourage using it.

提交回复
热议问题