Accéder à une fonction déclarée à l'intérieur d'une classe avec ceci.FunctionName (remarquez que la fonction Word est manquante)
class Person{
constructor(name)
{
this.name = name;
this.say();
}
/*notice the word function is missing*/
/*think of say() as a static method...every instance of Person has it...and you use it with this.say() in Class Person*/
say()
{
alert("say");
}
}
Javasper