js|jscript| operations
JScript has a full range of operators, including arithmetic, logic, bits, assignments, and some other operators.
instanceof
Calculated |
logical |
bit Operations |
Assigning values |
Miscellaneous |
|
|
|
|
|
Describe |
Symbol |
Describe |
Symbol |
Describe |
Symbol |
Describe |
Symbol |
Describe |
Symbol |
negative value |
|
logic not |
! |
bitwise reverse |
~ |
Assignment |
= |
delete |
delete |
increment |
|
less than |
< |
bitwise left |
<< |
op assignment |
OP = |
typeof operator |
typeof |
descending |
|
greater than |
> |
bitwise right-shift |
>> |
&NBSP; |
&NBSP; |
void |
void |
multiplication |
|
|
<= |
unsigned right-move |
>>> |
&NBSP; |
&NBSP; | TD style= "BORDER:0;PADDING:0;" >
instanceof |
Division |
|
is greater than or equal to |
>= |
bitwise AND |
& |
&NBSP; |
&NBSP; |
new |
new |
modulo operation |
|
equals |
|
bitwise XOR or |
^ |
&NBSP; |
&NBSP; |
in |
in |
addition |
|
does not equal |
!= |
bitwise OR |
| |
&NBSP; |
&NBSP; |
|
&NBSP; |
subtraction |
|
Logic and |
&& |
&NBSP; |
&NBSP; |
|
&NBSP; |
&NBSP; |
&NBSP |
&NBSP; |
&NBSP; |
logical OR |
| | |
&NBSP; |
&NBSP; |
&NBSP; |
&NBSP; |
&NBSP; |
&NBSP; |
&NBSP; |
&NBSP; |
condition (ternary operator) |
|
|
&NBSP; |
&NBSP; |
|
&NBSP; |
&NBSP; |
&NBSP; |
&NBSP; |
comma |
|
|
&NBSP; |
&NBSP; |
|
&NBSP; |
&NBSP; |
&NBSP; |
&NBSP; |
strictly equal |
|
&NBSP; |
&NBSP; |
|
&NBSP; |
&NBSP; |
|
|
Not strictly equal |
!== |
|
|
|
|
|
|
For example, the identity pair of the string "1" and the value 1 will result in a comparison of true. Strict equality does not cast different types of values, so it thinks that the string "1" is not the same as the value 1.
The basic string, numeric, and Boolean values are compared by value. If their values are the same, the comparison results are equal. Objects (including Array,Function,String,number,Boolean,Error, Date , and RegExp object) is compared by reference. Even if the two variables of these types have the same value, the comparison results are true only if they are exactly the same object.
For example:
Two basic strings with the same value. var string1 = "Hello";
var string2 = "Hello";
Two objects with the same value
. var StringObject1 = new String(string1);
var StringObject2 = new String(string2);
The comparison result is true
. if (string1 == string2)
executes certain commands (that will be run).
The comparison result is false
. if (StringObject1 == StringObject2)
//
executes some commands (does not run).
to compare
the value of an object,
or by using a
method. if (StringObject1.valueOf() == StringObject2)
//
executes certain commands (that will be run).