Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Error in Text Editor. Why can not I use let / const.

"let is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz)."

The same error message with const. Can anyone tell me what am I supposed to do with this error message? Thank you for your answers!

Edit: none of the ES2015 features are available for me. :(

1 Answer

What editor are you using? Generally JSHint or ESLint will require you to set the esversion you want to use, you would do this at the top of your JavaScript file.

In my case I use VSCode so I have to establish the esversion like so:

// jshint esversion: 6

It may change depending on your editor.

Dreamweaver and I just downloaded Sublime Text to solve the issue.