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
  • 25,747
  • 28
  • 93
  • 153

0 Answers0