标签:
1 function Person(name){ 2 this.name = name; 3 } 4 Person.prototype = { 5 constructor : Person, 6 7 sayName : function(){ 8 console.info(this.name); 9 }, 10 11 toString : function(){ 12 return "[Person "+this.name+"]"; 13 } 14 }
标签:
原文地址:http://www.cnblogs.com/zhanghuiyun/p/5658340.html