Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
169 views
in Technique[技术] by (71.8m points)

PhpStorm "Let definition are not supported by current JavaScript version"

I am trying to be a good little programmer and use the new tools available for coding JavaScript. Therefore I'm trying to use let instead of var to isolate variables.

This works fine in my browser however PhpStorm sees it as an error and when I hover above it gives me:

Let definition are not supported by current JavaScript version

So my question is how do I upgrade the current JavaScript version?

question from:https://stackoverflow.com/questions/35772101/phpstorm-let-definition-are-not-supported-by-current-javascript-version

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Go to

Settings / Languages & Frameworks / JavaScript

(it may be Preferences / Languages & Frameworks / JavaScript on some OSes)

...and set the "JavaScript language version" to "ECMAScript 6" (or, if they've updated to reflect current naming, "ECMAScript 2015" — or "ECMAScript 2016" or later if you're coding to a newer spec):

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...