yaofly2012 / teamShare

1 stars 1 forks source link

20190104-姚强 #9

Open yaofly2012 opened 5 years ago

yaofly2012 commented 5 years ago

理解new的执行过程

function A() {}
A.prototype.n = 1;
var b = new A();
A.prototype = {
    n: 2,
    m: 3
}
var c = new A();
console.log(b.n, b.m, c.n, c.m)  // 猜猜输出什么