Here’s a code example that creates an instance of a class named
const counter = new IncreasingCounter(); counter.value; // logs 'Getting the current value!' // → 0 counter.increment(); counter.value; // logs 'Getting the current value!' // → 1
Note that accessing the
... read the whole story at developers.google.com.