title: How do I add two numbers in JavaScript "without using `+` or `-` operators"?
body: <p>I know an alternative to using the <code>+</code> sign for addition is to do something like this:</p>
  
  <pre><code>int add(int a, int b)
  {
       if(b == 0)
           return sum;
       sum = a ^ b;
       carry = (a &amp; b) &lt;&lt; 1;
       return add(sum,carry);
  }
  </code></pre>
  
  <p>But I have two problems:</p>
  
  <ul>
  <li>This is C++, not JavaScript. Is this supported in JavaScript?</li>
  <li>It's obvious the whole trick is in <code>^</code> <code>&amp;</code> <code>&lt;&lt;</code>, but I don't know how to start looking for them in JavaScript, because <strong>I don't know what they are called</strong>.
  What should I be googling for even?</li>
  </ul>
  
  <p>I tried to write this in JavaScript ... but seems I miss something</p>
  
  <pre><code>var getSum = function(a, b) {
    return (a ^ b, (a &amp; b) &lt;&lt; 1)
  };
  </code></pre>