javaScript的面向对象的写法

function student()
{
this.name="黄龙";
this.age=22;
this.speak=function()
{
document.write(this.name+this.age);
}
}
var myStudent=new student();
myStudent.age=23;
myStudent.speak();




原文地址:https://www.cnblogs.com/longhuang/p/2101407.html