Home > Article > Web Front-end > Knowledge about operators in js
The
operator is used to perform program code operations and will perform operations on one or more operand items. 2+3, its operands are 2 and 3, and the operator is "+". In the previous article, we said that variables are used to store data, and the data in the same variable can be different at different times. During the running of the program, we perform operations on the data according to the corresponding rules as needed to obtain the expected results. Operations Symbols are the rules of operation.
Operators The basic commonly used operators in js include the following categories:
Assignment operator
Arithmetic operators
++: Divided into pre-add and post-add, When ++ comes first, it will be incremented by 1 first and then used; when ++ comes after, it will be used first and then incremented. And so on -- the same thing.
Connection operator: +
When "+" is applied to a non-numeric operator, it means Connect, perform a simple splicing operation on the operands
Comparison operator
Logical Operators
|, ||: If it is true, it is true
&, &&: If it is false, it is false
## Conditional operator (Original by Shanghai Shangxuetang web front-end training, please pay more attention, there will be articles related to JS and other front-end technologies)
The above is the detailed content of Knowledge about operators in js. For more information, please follow other related articles on the PHP Chinese website!