Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Destructuring assignments are not supported by current JavaScript version

I followed the steps here to configure code completion and other stuff in WebStorm but I'm still getting the following syntax errors.

enter image description here

How can I resolve this?

like image 609
THE JOATMON Avatar asked Jun 07 '16 20:06

THE JOATMON


People also ask

What is Destructuring assignment in JavaScript?

The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.

What is destructuring in node js?

JavaScript Object Destructuring is the syntax for extracting values from an object property and assigning them to a variable. The destructuring is also possible for JavaScript Arrays. By default, the object key name becomes the variable that holds the respective value.

Is not supported by JavaScript?

Go to the web browser menu click on the Customize and control Google Chrome. Next, select Settings and click on the Show advanced settings. Under Privacy click on the Content settings. Locate the JavaScript section and select Allow all sites to run JavaScript (recommended).


1 Answers

By changing 'JavaScript language version' (Settings/Languages & Frameworks/JavaScript) accordingly, to either 'ECMASCript 6' or 'JSX Harmony'. BTW, WebStorm can do it for you: hit Alt+Enter on the highlighted statement, choose 'Change JavaScript version to ECMASCript 6' from the popup

like image 144
lena Avatar answered Oct 17 '22 11:10

lena