9
I was experimenting with the class declaration syntax ES6/ES-2015, and could not declare properties, only methods:
class Teste {
constructor() {
}
metodo() {
}
// não funciona:
//propriedade: valor
}
Is there any way to declare instance properties in the class body? If it does not exist, what would be the justification for it to have been conceived like this?
@Renan But with get/set are not properties, are access methods (is that the term?). I wanted to know properties "for real".
– bfavaretto