function person () {}person.prototype.name = ' Sun '; Var person1 = new person (); Alert ("Person original prototype:" +person1.name);// The first rewrite of the prototype person.prototype = {constructor : person, //an explicit declaration constructorname : ' Cheng ', Age : 18};alert ("prototype is overwritten after P1:" +person1.name); //sun//new instance var Person2 = new person (); alert ("P2 after prototype coverage:" +person2.name) //chengalert ("original : "+ person1.constructor); //points to Personalert (" after: "+ person2.constructor); //pointing person//The second time covering prototype person.prototype = {constructor : person,name : ' FFFF ', Age : 18};alert ("prototype covered after P1:" +person1.name); //sunalert ("Prototype covered P2:" +person2.name) ; //chengvar person3 = new person (); alert ("P3 after prototype coverage:" +person3.name);   //FFF
The above tests can be seen:
1: The object instance created before the prototype rewrite, always points to the pre-rewrite prototype
2: An object instance created after the prototype rewrite, always pointing to the newly rewritten prototype;
3: Multiple rewritten prototypes can exist at the same time and can all be associated with a function object through constructor. ?
In summary, the [[prototype]] pointer in the object instance always points to the most recent function prototype before the object instance is created and never changes;
Multiple prototypes can exist at the same time and are associated with function objects; (you need to explicitly declare constructor)
Understand the dynamics of JavaScript prototypes