A small detail
do not run the browser side first, try to give the output of the following code and explain it.
related codes
let pre = "Bob";
let full = pre + " angel";
class Person {
construct() {}
get preName() {
console.log("preName getter!");
return pre;
}
set preName(value) {
pre = value;
console.log("preName setter!");
}
get fullName() {
console.log("fullNmae getter!");
return full;
}
set fullName(value) {
full = value;
console.log("fullName setter!");
}
}
let myName = new Person();
myName.preName = "Linda";
console.log(myName.preName);
console.log(myName.fullName);
what result do you expect? What is the actual running result?