1. js函数

var table = function(){
    var totalCount = 10;
    
//给函数添加一个方法,返回成员变量的值,供调用
this.getTotalCount = function(){ return totalCount; }; };

2. 调用

//调用函数对象的成员方法
new
table().getTotalCount()

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2021-10-30
  • 2022-12-23
  • 2021-09-02
猜你喜欢
  • 2022-12-23
  • 2021-09-18
  • 2022-02-15
  • 2021-11-06
  • 2021-05-25
  • 2022-02-09
  • 2019-01-10
相关资源
相似解决方案