Home > Article > Web Front-end > What are the operators in javascript
The operators in JavaScript include: 1. Arithmetic operators; 2. Assignment operators; 3. String operators; 4. Comparison operators; 5. Conditional operators; 6. Logical operators; 7. Bit operators.
JavaScript arithmetic operators
(Video tutorial recommendation: javascript basic tutorial)
Arithmetic operators are used to perform operations on two variables or values.
Assignment y = 5, the following table will explain to you the use of arithmetic operators:
JavaScript assignment operator
Assignment operation symbol is used to assign values to JavaScript variables.
Given x=10 and y=5, the following table explains the assignment operators:
JavaScript String Operators
operator, = operator can be used to concatenate strings.
Given text1 = "Good ", text2 = "Morning", and text3 = "", the following table explains the use of string operators:
Comparison operators
Comparison operators are used to judge logical statements to determine whether two given values or variables are equal.
Given x=5, the following table shows the use of comparison operators:
Conditional operator
Conditional operator uses For conditional assignment operations.
Given x=6 and y=3, the following table demonstrates the operation of conditional operators:
Logical operators
Logical operators are used to determine logical relationships between variables or values.
Given x=6 and y=3, the following example demonstrates the use of logical operators:
JavaScript Bitwise Operators
Bit operators work on 32-bit numbers. Any numeric operations will be converted to 32 bits. The result is converted to a JavaScript number.
Related recommendations: js tutorial
The above is the detailed content of What are the operators in javascript. For more information, please follow other related articles on the PHP Chinese website!