码迷,mamicode.com
首页 > 其他好文 > 详细

employee

时间:2018-11-11 20:13:20      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:prototype   type   str   this   bsp   cto   fun   var   UNC   

function employee(name,age){     //JS里面无论什么类型都是function

this.name=name;                         

this.age=age;

}

employee.prototype={                  

constructor:employee,      

sayName:function(){ alert(this.name) };

};

var employee1=new employee("111",19);

alert(employee1.sayName()); 

employee

标签:prototype   type   str   this   bsp   cto   fun   var   UNC   

原文地址:https://www.cnblogs.com/925039847z/p/9943024.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!