javascript - Visual Studio Code 'const' can only be used in a .ts file -
i getting error while trying write basic js in visual studio code.
already tried changing settings.json ( $workspace/.vscode/settings.json ) doesn't work.
{ "javascript.validate.enable": false }
are sure right javascript syntax?
class books { static const max_width = 8.5; }
so far know, it's not possible define static property in es2015.
you may try way else, example:
class books { static max_width() { return 8.5; } } console.log(books.max_width);//8.5
Comments
Post a Comment