function Me(name)
{
  this.name=name;
  //对象方法
  this.Introduce=function(){
    alert("My name is "+this.name);
  }
}
//类方法
Me.Like=function(){
  alert("LOL");
}
//原型方法
Me.prototype.IntroduceCn=function(){
  alert("我的名字是"+this.name);
}

 

//测试开始

var p1=new Me("小白");

p1.Introduce();

Me.Like();

p1.IntroduceCn(); 
View Code

相关文章:

  • 2021-12-23
猜你喜欢
  • 2021-07-10
  • 2021-12-22
  • 2021-11-26
  • 2021-10-13
  • 2021-05-16
相关资源
相似解决方案