I have newest google chrome currently version 80.0.3987.87. I copied example from JS docs which is
class ClassWithPrivateMethod {
#privateMethod() {
return 'hello world'
}
getPrivateMessage() {
return #privateMethod()
}
}
const instance = new ClassWithPrivateMethod()
console.log(instance.getPrivateMessage())
// expected output: "hello world"
and paste it to console. I should get Hello World but instead I have error:
Uncaught SyntaxError: Unexpected token '('
from second line where I declare private method. Why error, what is wrong with my environment? I don't think MDN docs are incorrect..