function Book(){}
Book.prototype.__defineGetter__("name",function(){return "《"+this.bookName+"》";});  
Book.prototype.__defineSetter__("name",function(name){this.bookName=name;}); 

var book=new Book();
book.name="书本"
alert(book.name);

 类似c# get  set

相关文章:

  • 2021-11-27
  • 2022-01-20
  • 2021-10-21
  • 2021-07-22
  • 2022-12-23
  • 2021-12-04
  • 2022-01-11
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
相关资源
相似解决方案