原型的动态性

这是对《高级3》的P156页,原型的动态性的理解

function Person(){

    }

    var oldproto = Person.prototype;

    var friend = new Person();

    Person.prototype = {
        constructor: Person,
        name: "Nicholas",
        age: 29,
        job: "Software Engineer",
        sayName: function () {
            alert(this.name);
        }
    };


    console.log(oldproto);
    console.log(Person.prototype);
原文地址:https://www.cnblogs.com/masita/p/5088005.html