Arithmetic Operators
Description symbol
Negative value-
Increment ++
Decrease-
Multiplication *
Division/
Modulo operation %
Addition +
Subtraction-
Arithmetic Operators
Description symbol
Negative value-
Increment ++
Decrease-
Multiplication *
Division/
Modulo operation %
Addition +
Subtraction-
Logical operators
Description symbol
Non-logical!
Less than <
Greater than>
Less than or equal to <=
Greater than or equal to> =
Equal to =
Not equal! =
Logic &&
Logic or |
Condition (ternary operator )? :
Comma,
Strictly equal =
Not strictly equal! =
Bitwise operators
Description symbol
Bitwise inversion ~
Shift left by bit <
Shift right by bit>
Unsigned shift to the right >>>
Bitwise AND &
By bit or ^
By bit or |
Value assignment operator
Description symbol
Assignment =
Assignment op =
Arithmetic Operators
Description symbol
Negative value-
Increment ++
Decrease-
Multiplication *
Division/
Modulo operation %
Addition +
Subtraction-
Logical operators
Description symbol
Non-logical!
Less than <
Greater than>
Less than or equal to <=
Greater than or equal to> =
Equal to =
Not equal! =
Logic &&
Logic or |
Condition (ternary operator )? :
Comma,
Strictly equal =
Not strictly equal! =
Bitwise operators
Description symbol
Bitwise inversion ~
Shift left by bit <
Shift right by bit>
Unsigned shift to the right >>>
Bitwise AND &
By bit or ^
By bit or |
Value assignment operator
Description symbol
Assignment =
Assignment op =
Miscellaneous Operators
Description symbol
Delete Delete
Typeof operator typeof
Void void
Instanceof
New
In in
The difference between = (equal) and = (strictly equal) Is that constant operators forcibly convert different types of values before comparison. For example, the comparison result of the constant parameter on the string "1" and the value 1 is true. Strict equality does not force conversion of different types of values, so it considers that the string "1" is different from the value 1.
The basic strings, values, 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 objects) are compared by reference. Even if the two variables of these types have the same value, the comparison result is true only when they are exactly the same object.
For example:
// Two basic strings with the same value.
VaR string1 = "hello ";
VaR string2 = "hello ";
// Two string objects with the same value.
VaR stringobject1 = new string (string1 );
VaR stringobject2 = new string (string2 );
// The comparison result is true.
If (string1 = string2)
// Execute some commands (to be run ).
// The comparison result is false.
If (stringobject1 = stringobject2)
// Execute some commands (not run ).
// Compare the value of the string object,
// Use the tostring () or valueof () method.
If (stringobject1.valueof () = stringobject2)
// Execute some commands (to be run ).
Description symbol
Delete Delete
Typeof operator typeof
Void void
Instanceof
New
In in
The difference between = (equal) and = (strictly equal) Is that constant operators forcibly convert different types of values before comparison. For example, the comparison result of the constant parameter on the string "1" and the value 1 is true. Strict equality does not force conversion of different types of values, so it considers that the string "1" is different from the value 1.
The basic strings, values, 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 objects) are compared by reference. Even if the two variables of these types have the same value, the comparison result is true only when they are exactly the same object.
For example:
// Two basic strings with the same value.
VaR string1 = "hello ";
VaR string2 = "hello ";
// Two string objects with the same value.
VaR stringobject1 = new string (string1 );
VaR stringobject2 = new string (string2 );
// The comparison result is true.
If (string1 = string2)
// Execute some commands (to be run ).
// The comparison result is false.
If (stringobject1 = stringobject2)
// Execute some commands (not run ).
// Compare the value of the string object,
// Use the tostring () or valueof () method.
If (stringobject1.valueof () = stringobject2)
// Execute some commands (to be run ).
Description symbol
Non-logical!
Less than <
Greater than>
Less than or equal to <=
Greater than or equal to> =
Equal to =
Not equal! =
Logic &&
Logic or |
Condition (ternary operator )? :
Comma,
Strictly equal =
Not strictly equal! =
Bitwise operators
Description symbol
Bitwise inversion ~
Shift left by bit <
Shift right by bit>
Unsigned shift to the right >>>
Bitwise AND &
By bit or ^
By bit or |
Value assignment operator
Description symbol
Assignment =
Assignment op =
Miscellaneous Operators
Description symbol
Delete Delete
Typeof operator typeof
Void void
Instanceof
New
In in
The difference between = (equal) and = (strictly equal) Is that constant operators forcibly convert different types of values before comparison. For example, the comparison result of the constant parameter on the string "1" and the value 1 is true. Strict equality does not force conversion of different types of values, so it considers that the string "1" is different from the value 1.
The basic strings, values, 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 objects) are compared by reference. Even if the two variables of these types have the same value, the comparison result is true only when they are exactly the same object.
For example:
// Two basic strings with the same value.
VaR string1 = "hello ";
VaR string2 = "hello ";
// Two string objects with the same value.
VaR stringobject1 = new string (string1 );
VaR stringobject2 = new string (string2 );
// The comparison result is true.
If (string1 = string2)
// Execute some commands (to be run ).
// The comparison result is false.
If (stringobject1 = stringobject2)
// Execute some commands (not run ).
// Compare the value of the string object,
// Use the tostring () or valueof () method.
If (stringobject1.valueof () = stringobject2)
// Execute some commands (to be run ).