This is the error I get when using const:
When you start using ECMAScript 6 this error thrown by your IDE.
There are two options available:
if you have only one file and want to use the es6 then simply add below line at the top of the file.
/*jshint esversion: 6 */
Or if you have number of js file or you are using any framework(like nodejs express)you can create a new file named .jshintrc in your root directory and add code below in the file:
{
"esversion": 6
}
If you want to use the es6 version onward for each project you can configure your IDE.