Why bitwise operation (~0); prints -1 ? In binary , not 0 should be 1 . why ?
(~0);
I think the real reason is that ~ is Two’s Complement.
Javascript designates the character tilde, ~, for the two’s complement, even though in most programming languages tilde represents a bit toggle for the one’s complement.