Javascript operators

From wikinotes
Revision as of 21:48, 27 August 2021 by Will (talk | contribs) (→‎equality greater/less than)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

and/or

&& ||      // condition AND/OR condition

equality greater/less than

== !=      // equality        ( '1' == 1 )
=== !==    // strict equality ( '1' !=== 1 )
< > <= >=  // greater-than less-than

bitwise operators

x | y      // bitwise or               (set binary bit)
x ^ y      // bitwise exclusive and    (unset binary bit)
x & y      // bitwise and              (intersection of binary bits)
x << n     // bitwise shift by n bits
x >> n     // bitwise shift by n bits
~x         // invert bits