Skip to main content

JavaScript Question 139

Question 139 of 0JavaScript

What's the output?

Login Required

Please login to select answers and solve this question. You can view the question without logging in.

Code:
class Counter {
  #number = 10
  increment() {
    this.#number++
  }
  getNum() {
    return this.#number
  }
}

const counter = new Counter()
counter.increment()
console.log(counter.#number)

Select the correct option: