526
OPUS Projektor Manual
JavaScript
Value 42 is assigned to
variable i
both statements need to be
true (AND)
only one statement need to
be true (OR)
negation of a statement
(NOT)
Check if bit is set. In binary:
0010 & 0111 = 0010
Set a bit. In binary: 0010 |
0111 = 0111
Toggle a bit. In binary: 0010
& 0111 = 0101
Shift bits to the left. In binary:
0010 << 1 = 0100
Shift bits to the right. In
binary: 0010 >> 1 = 0001
Shift right and fill with zeros.
In binary: 1010 >>> 2 = 0010
Loops
Loops can be used in JavaScript similar to many other programming languages.
WARNING: A loop stops execution of the main application until it is finished. So make sure
that only very short loops are used.
WARNING: Loops should and can NOT be used to "wait" within a JavaScript program. You
can NOT "spend time" within one JavaScript. If you need to time something, use the repeated