Wewnętrzne metody kontra statyczne
class Person {
constructor(myName) {
this.name = myName;
console.log(this.getName());
}
getName() {
return this.name;
}
static getName2() {
return 'getName2 result';
}
}
/*getName can be access either inside the class as this.getName or any instance p of TestClass can access with p.getName()...getName2 However, can only be access via Person.getName2() instances do NOT have access*/
Javasper