My version of node is 4.2.2. When learning es6, write a script. Can I only use babel to convert it to es5 and then execute it? Can node run es6 code directly? I searched and said
node --harmony index.js, seems to have no effect
To add, my index.js code is as follows. this code
node --harmony index.jsIt was a mistake
let a = 100; console.log(a);
If we change let to const, we can run it. does this version of node not support let yet?
No need to add
However, it is necessary to know which es6 features are supported. Not all es6 features are supported.
'use strict'; let a = 100; console.log(a);