title: The Difference between ++num vs num++
body: <p>After reading these two posts: </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/3469885/somevariable-vs-somevariable-in-javascript">++someVariable Vs. someVariable++ in Javascript</a></li>
  <li><a href="http://community.sitepoint.com/t/variable-vs-variable/6371" rel="nofollow noreferrer">http://community.sitepoint.com/t/variable-vs-variable/6371</a></li>
  </ul>
  
  <p>I am still confused on the following code:</p>
  
  <pre><code>var num = 0;
  
  num++ // returns 0
  
  ++num // returns 1
  </code></pre>
  
  <p>Why dose <code>num++</code> return 0?</p>
  
  <p>I understand that it assigns first, then adds one, <strong><em>but I still don't understand why it doesn't display the 1.</em></strong></p>
  
  <pre><code>var num = 0;
  
  num++ // returns 0
  
  num // returns 1
  </code></pre>
  
  <p>I am really confused with the following example:</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>var num = 0;
  
  num++
  // assigns then increments
  
  // So if it assigns the num = 0, then increments to 1, Where is one being 
  //stored? Is it assigned anywhere?
  </code></pre>
  
  <p>Or does it assign the expression.</p>
  
  <p>(I imagine the expression is this: num = num + 1;)</p>
  
  <p>This is probably my best guess but it still isn't 100% clear to me, I still don't understand why num++ displays/returns 0 instead of having the expression being evaluated and returning 1.</p>