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}`);