Article From:https://segmentfault.com/q/1010000011703697
Question:

“use strict”;
// Declare variable ABC
let { age: abc } = { age: 16 };

console.log(abc);
//My node version is 5.7.0, but it always doesn’t work when writing simple functions, always reporting syntax errors {, because of version problems? The compiler I use is vscode.

Answer 0:

http://node.green/ It can be seen that node5.12.0 supports let, but it is only 59%.

And your code is no problem in my 6.11.4 version.
The popularity of the updated 6.11.4 version is 99%.

Answer 1:

letIt is ES6 syntax. It needs to use Node 8 version above. It is recommended to download the latest version of the official version.

Leave a Reply

Your email address will not be published. Required fields are marked *