Course · Section 14: Object-Oriented Programming (OOP) With JavaScript · Lecture 236: Encapsulation: Private Class Fields and Methods
Using a class with a private `#count` field, an `inc()` method, and a `value` getter, implement `privateCounter(times)` returning the count after `inc()` is called `times` times.
+ 1 hidden test run on Submit.
A private field encapsulates state, mutated only through the class's own methods.
Run your code to see results.