class User {
constructor(first, last) {
this.firstName = fist
this.lastName = last
}
get fullName(){
return `${this.fistName} ${this.lastName}`
}
set fullName(value){
[this.fistName, this.lastName] = value.split(' ');
}
}
const heropy = new User('Heropy', 'Park');
heropy.firstName = 'Neo';
console.log(heropy.fullName); //Heropy Park
heropy.fullName = 'Neo Anderson'