构造函数 function Dad(){ //私有成员-只有公有方法才能调取 let _weight='80kg'; this.age=20 }; //静态属性-只能通过类来调用,实例化对象是调用不了的 Dad.num=10; //静态方法-只能通过类来调用,实例化对象是调用不了的 Dad.getNum=function(){cosole.log('静态方法')} Dad.prototype.add=function(){console....
构造函数 function Dad(){ //私有成员-只有公有方法才能调取 let _weight='80kg'; this.age=20 }; //静态属性-只能通过类来调用,实例化对象是调用不了的 Dad.num=10; //静态方法-只能通过类来调用,实例化对象是调用不了的 Dad.getNum=function(){cosole.log('静态方法')} Dad.prototype.add=function(){console....