为什么class的实例化对象会拷贝类的属性数据,而function的不会。
function Person () {
b = 1
function fn () {}
}
Person.prototype.a = 1
var persion = new Person()
console.log(persion);
console.log('---------')
class A {
a = 1
fn () {
}
}
var a = new A()
console.log(a)
点开Person的Prototype看看里面是啥~