Operators JavaScript Tutorial

The bitwise NOT is represented by a tilde (~).
The bitwise NOT is a three-step process:
The operand is converted to a 32-bit number.
The binary form is converted into its one's complement.
The one's complement is converted back to a floating-point number.

var iNum1 = 25;        //25 is equal to 00000000000000000000000000011001
var iNum2 = ~iNum1;    //convert to 111111111111111111111111111100110
alert(iNum2);          //outputs "-26"