a - b = 23
a / b = 3.3
a% b = 3
a + b + c = 43Test
a ++ = 33
b-- = 10
Đặt biến vào các giá trị khác nhau và thử thử .
JavaScript supports the following comparison operators:
Suppose variable A holds value 10 and variable B holds a value of 20, then:
STATE DEBT AND DESCRIPTION1= = (Equal)
Check if the value of the two operands is equal or not, if any, the condition becomes true.
Ex: (A == B) is not true.
2! = (Unbalanced)
Check if the value of the two operands is balanced or not, otherwise the condition becomes true.
Ex: (A! = B) is true.
3> (Larger)
Check if the value of the left operand is greater than the right operand, if any, the condition becomes true.
Ex: (A> B) is not true.
4<(Smaller)
Check if the value of the left operand is less than the right operand, if any, the condition becomes true.
Ex: (A 5
> = (Greater than or equal to)
Check if the value of the left operand is greater than or equal to the right operand, if any, the condition becomes true.
Ex: (A> = B) is not true.
6<= (Less than or equal to)
Check if the value of the left operand is less than or equal to the right operand, if any, the condition becomes true.
Ex: (A <= B) is true.
For example
The following code shows how to use comparison operators in JavaScript:
You should read it
- ! = and! == What is the difference in JavaScript?
- The difference between the == and === operators in JavaScript
- Operator in PHP
- Operator in C ++
- Void keywords in JavaScript
- Boolean operators AND and OR in SQL
- Syntax of JavaScript
- C Shell operators
- Load the stack of assignment operators in C ++
- Basic Shell operators
- What is JavaScript? Can the Internet exist without JavaScript?
- Korn Shell Operator