| layout | api-command | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| language | JavaScript | ||||||||||
| permalink | api/javascript/bit_not/ | ||||||||||
| command | bitNot | ||||||||||
| io |
|
||||||||||
| related_commands |
|
{% apibody %} r.bitNot() → number {% endapibody %}
A bitwise NOT, or complement, is a unary operation that performs logical negation on each bit, forming the ones' complement of the given binary value. Bits that are 0 become 1, and those that are 1 become 0.
Example:
r.expr(7).bitNot().run(conn);
// Result:
-8