Code QuizAdvanced

Revealing Module Counter Bug

Spot why the exposed count never updates in this revealing module pattern.

Codejavascript
const Counter = (function () {
  let count = 0;

  function increment() {
    count++;
  }

  function getCount() {
    return count;
  }

  return {
    count: count,
    increment: increment,
    getCount: getCount
  };
})();

Counter.increment();
Counter.increment();
console.log(Counter.count);    // expected 2
console.log(Counter.getCount());

Why does Counter.count log 0 instead of the updated value?