JavaScript Bitwise NOT Operator



Bitwise NOT Operator

~ symbol is used for Bitwise NOT operator.

Bitwise NOT operator takes a value/variable as right hand side operand, performs NOT logic gate operation at bit level, and returns their result.

~a
~6

Examples

1. Bitwise NOT of value in a.

a = 7;
output = ~a;
console.log(`~${a} = ${output}`);