function Tree () {}Tree.prototype.leaf = 0Tree.prototype.addLeaf = function () {this.leaf++}let tree1 = new Tree()let tree2 = new Tree()tree1.addLeaf()tree1.addLeaf()console.log(tree2.leaf) 这里我把箭头函数去掉下为什么输出是0.......求解惑
添加回答
举报
0/150
提交
取消
