Присвоение свойства возвращаемое значение функции в классе
class Person
{
constructor(name)
{
this.name = name;
const fm= () => {
return "XXXXXX";
}
const fn = async () => {
return "XXXXXX";
}
this.y = fm();
this.z = fn();
}
}
/*y will just be a assigned a string*/
/*z will be assigned a promise*/
Javasper