复制1class Counter { 2 #number = 10 3 4 increment() { 5 this.#number++ 6 } 7 8 getNum() { 9 return this.#number 10 } 11} 12 13const counter = new Counter() 14counter.increment() 15 16console.log(counter.#number)
1class Counter { 2 #number = 10 3 4 increment() { 5 this.#number++ 6 } 7 8 getNum() { 9 return this.#number 10 } 11} 12 13const counter = new Counter() 14counter.increment() 15 16console.log(counter.#number)
本题为“单选题”
题库维护不易,您的支持就是我们最大的动力!