title: Why ~N is doing -(N + 1) in JavaScript?
body: <p>Look at the below examples please: </p>
  
  <pre><code>console.log(~-2); //1
  console.log(~-1); //0
  console.log(~0); //-1
  console.log(~1); //-2
  console.log(~2); //-3
  console.log(~true); //-2
  console.log(~false); //-1
  </code></pre>
  
  <p>Why <code>~N</code> is operating like <code>-(N + 1)</code> ?</p>