class test {
set xx(v){
console.log('i am set');
this.__ok = v;
}

get xx(){
console.log('i am get');
return 100;
}
}

function testFn(){
const y = new test();
return y.xx = 200;
}

console.log(testFn());

上面段代码执行将打印出什么内容,为什么?

相关文章:

  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2021-04-27
  • 2021-12-29
  • 2021-11-07
猜你喜欢
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2021-08-07
  • 2021-09-01
  • 2022-12-23
相关资源
相似解决方案