Java Reference
In-Depth Information
(continued)
naMe
introduced
Meaning
Prefix increment
JavaScript 1.0
++v1 * v2(v1 + 1) * v2
Note: v1 will be left as v1 + 1 .
Postfix increment
JavaScript 1.0
v1++ * v2(v1 * v2)
v 1 is then incremented by 1 .
Prefix decrement
JavaScript 1.0
-- v1 * v2(v1 - 1) * v2
Note: v1 is left as v1 ‐ 1 .
Postfix decrement
JavaScript 1.0
v1 -- * v2(v1 * v2)
v1 is then decremented by 1 .
Bitwise operators
Bitwise operators work by converting values in v1 and v2 to 32‐bit binary numbers and then
comparing the individual bits of these two binary numbers. The result is returned as a normal
decimal number.
naMe
introduced
Meaning
Bitwise AND
JavaScript 1.0
v1 & v2
The bitwise AND lines up the bits in each operand and
performs an AND operation between the two bits in the same
position. If both bits are 1 , the resulting bit in this position of
the returned number is 1 . If either bit is 0 , the resulting bit in
this position of the returned number is 0 .
Bitwise OR
JavaScript 1.0
v1 | v2
The bitwise OR lines up the bits in each operand and performs
an OR operation between the two bits in the same position. If
either bit is 1 , the resulting bit in this position of the returned
number is 1 . If both bits are 0 , the resulting bit in this position
of the returned number is 0 .
Bitwise XOR
JavaScript 1.0
v1 ^ v2
The bitwise XOR lines up the bits in each operand and
performs an XOR operation between the two bits in the same
position. The resulting bit in this position is 1 only if one bit
from both operands is 1 . Otherwise, the resulting bit in this
position of the returned number is 0 .
Bitwise NOT
JavaScript 1.0
v1 ~ v2
Inverts all the bits in the number.
Search WWH ::




Custom Search