Operator is used to execute program code operations and is calculated for one or more operand items. 2+3, whose operands are 2 and 3, while 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, in the process of running the program, we need to do the corresponding rules of the operation of the data to achieve the desired results, operators are the rules of the operation.
Operators in JS have the following classes of basic common operators:
Assignment operators
Arithmetic operators
+ +: is divided into pre-plus and post-plus, when + + in front, then the first self-increment 1 and then use, when + + in the latter, then the first use of self-increment. And so on--the same.
Join operator: +
When the "+" is applied on a non-numeric operator, the connection is made, and the operand is simply spliced.
Comparison operators
logical operators
|, | | | : True and True
&, &&: false or False
conditional operator (Shanghai Shang Academy web Front End Training original, please pay more attention, successively have JS and other front-end technology related articles on)
JavaScript Building JS operator