function Tree () {}
Tree.prototype.leaf = 0
Tree.prototype.addLeaf = function () {this.leaf++}
let tree1 = new Tree()
let tree2 = new Tree()
tree1.addLeaf()
console.log(tree2.leaf)
这里我把箭头函数去掉下为什么输出是0.......求解惑
0
相关分类