title: Meaning of !! javascript
body: <p>I found some code about authentication with angular and i can't understand this trick :</p>
  
  <pre><code>authService.isAuthenticated = function () {
      return !!Session.userId;
  };
  </code></pre>
  
  <p>What does <code>!!</code> mean 'different of userId' ?</p>
  
  <p>whenever <code>true = !!true = !!!!true =&gt;etc</code>, it don't understand this.</p>
  
  <p>Somebody can help me? </p>
  
  <p>(<a href="https://medium.com/opinionated-angularjs/techniques-for-authentication-in-angularjs-applications-7bbf0346acec" rel="nofollow">https://medium.com/opinionated-angularjs/techniques-for-authentication-in-angularjs-applications-7bbf0346acec</a> for the source , part 'The AuthService')</p>