According to the documentation:
Class body and definition of methods
Edit
The body of a class is the part that is between the braces {}. This is the place where class members are defined, such as methods or constructors.
Strict mode
The body of class declarations and class expressions are executed in strict mode.
Builder
The constructor method is a special method to create and initialize an object created with a class. There can only be one special method with the name "constructor" in a class. If it contains more than one occurrence of the constructor method, an Error SyntaxError will be thrown
A constructor can use the super reserved word to call the constructor of a superclass
Prototype methods
documentation link
Example with your code:
class Usuario{
get foo(){
let a = this.bar();
}
bar(){
console.log('si')
return true;
}
}
usr = new Usuario
usr.foo;
class Usuario{
get foo(){
let a = this.bar();
}
bar(){
console.log('Método bar')
return true;
}
}
usr = new Usuario
usr.foo;