javascript 面向对象继承和泛型 记录
摘要:
根据《JavaScript高级程序设计》 中的内容自己写的一个测试demo,记录一下var Person = function(name){ this.Name=name; };Person.prototype.sayHello=function(){alert(this.Name);};//学生类,继承Person var Student = function(name,grade){ Person.call(this,name); this.Grade=grade; };//使用原型呼叫基类,完成继承Student.prototype =... 阅读全文
posted @ 2012-07-25 11:07 Mr_Cod 阅读(293) 评论(0) 推荐(0)
浙公网安备 33010602011771号