JavaScript 模拟类机制及私有变量的方法及思路(2)


  function MyClass(param) {
    var privateVar = ...;
    this.param = param;
    this.func = function() {
      alert(privateVar);
    };
  }


您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdgwxs.html