Can I have a class like this?
class Human {
constructor(name) {
this.name = name;
}
someMethod() {
this.hasBrain = true;
console.warn(this.hasBrain);
}
}
This is working and not throwing any error.
My question is, now, is hasBrain a class property or it is a class field? if it is a class field, Does it have to be declared?