title: why does counter() function return 0 despite having count++?
body: <p>Why does the <code>count()</code> return 0 despite having count++ in the nested function?
  The<code>count</code> variable i.e <code>0</code> is accessed in <code>xyz()</code> due to lexial scoping, but why does the <code>counter()</code> function return 0 the first time, when the count++ must have changed the value of <code>count</code> to 1?
  Shouldn't the console.log() return 1,2,3 due to count++?</p>
  <pre><code>
  function makeCounter() {
    let count = 0;
  
    return function xyz() {
      return count++;
    };
  }
  
  let counter = makeCounter();
  
  alert( counter() ); // 0
  alert( counter() ); // 1
  alert( counter() ); // 2```
  
  </code></pre>