JavaScriptのprototype
function person(name){
this.name = name;
this.prof = function(){
console.log("name : " + this.name + "\nage : " + this.age + "\ncolor : "+ this.color + "\nweight : " + this.weight);
}
}
person.prototype.color = "red";
person.prototype.age = "18";
var man = new person("Jackbow");
man.weight = 50;
man.prof();
この man.weight = 50;
を
man = {
weight : 50
};
にしてはいけないのはなぜですか?