let user = {
get name() {
return 'mary';
},
set name(value) {
this.name = value //这句话报错了
}
};
user.name = "Peter"; //尝试赋值的时候报错Uncaught RangeError: Maximum call stack size exceeded
console.log(user.name);
猛跑小猪
开满天机
相关分类