var Person = (function(){
  var Constr;
  Constr = function(){
    this.name = 'carl';
  }
  Constr.prototype = {
    constructor : Constr,
    getName : function(){
    return this.name;
  }
}
  return Constr;
}())
var obj = new Person();
console.log(obj.getName());  //输出:carl

相关文章:

  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2021-09-13
猜你喜欢
  • 2021-12-19
  • 2021-09-12
  • 2021-09-06
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案