//创建一个Student原型
'function Student (name){
this.name =name;
this.say=function(){
return "Hello, "+this.name+"!"
}
}'
//使用Student原型创建一个小明实例
'
var xiaoming =new Student('小明');
xiaoming.name //‘小明’
xiaoming.say() //"Hello, 小明!"
'
//使用prototype属性创立实例共同方法
Student.prototype.run = function(){
return this.name+'running!'
}
xiaohong.run =xiaoming.run; //ture;