About Prototype

When new an Object, if we call the instance's attr/func which is in the prototype, it will look up to the prototype and return the correct value. But if we try to modify the attr/func in the instance, it will crate a new one but the prototype one.

var Car = function DD(make, color){
    var make = make;
}

//Car.prototype.price = 18;

var car1 = new Car("Benz", "white"),
    car2 = new Car("AAA","red");

alert(car1.price); //undefined 
Car.prototype.price = 20;
alert(car1.price);  //20
car1.price = 30;
alert(car1.price);  //30

Car.prototype.price = 40;

alert(car1.price); //30
alert(car2.price); //40