I was going through MDN docs about Javascript classes and somehow my nodejs runtime couldn't run the file. I am using node v16.1.0.
Code
class Fraction {
static {
console.log('hello')
}
}
Error
$ node fraction.js
/Users/imechemi/fraction.js:3
static {
^
SyntaxError: Unexpected token '{'
I runs fine on repl (https://replit.com/@imechemi/PitifulWorthyDistributedcomputing#index.js) and also on my browser. What should I do to make it work on my nodejs runtime.