Code Snippet is as below
class Test {
static a = 10;
b = 20;
}
console.log(Test.a);
Error Log is as below
C:\Users\Zephyr\Documents\JavaScriptLearning\staticdemo.js:2 static a = 10; ^ SyntaxError: Unexpected token = at new Script (vm.js:80:7)
Please help this I am trying in Visual Studio Code. Not sure what is the error and why this error is coming. Ideally I should see 10 as output. Please help