1

Possible Duplicate:
javascript bitwise operator question

Documentation says, that it is bitwise NOT. But I don't understand these examples:

var a = ~1; a
-2
var a = ~8; a
-9
var a = ~-1; a
0
Community
  • 1
  • 1
Sergey Metlov
  • 24,666
  • 27
  • 90
  • 147

0 Answers0