var Student=function(){
this.greet=function(){console.log("hello");};
};
Student.prototype={
go:function(){console.log("byebye");}
}
定义一个类,应该把这个类的实例方法,写在构造函数里面,还是挂在prototype上面?为什么?
valueOf,toString,如果要重写这两个函数,应该写在构造函数中,还是prototype上面?