title: What do two consecutive minus signs mean in a return statement?
body: <p>In typescript, I have the following:</p>
  
  <pre><code>self.newId = 0;
  
  self.GetNewId = () =&gt; {
                  return --self.newId;
                  };
  </code></pre>
  
  <p>My guess is that <code>return --self.newId;</code> does two things:</p>
  
  <ol>
  <li>it returns the current value of <code>self.newId</code></li>
  <li>it then decreases the value of <code>self.newId</code> by 1. (To -1)</li>
  </ol>
  
  <p>I assume that the next time that <code>GetNewId</code> is called, it will return <code>-1</code> and then decrease the value to <code>-2</code>, etc.</p>
  
  <p>Can anyone confirm</p>