What expressions and operators does JavaScript have?
This article focuses on "what expressions and operators JavaScript has". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn what expressions and operators JavaScript has!
1. Expression
After defining variables, they can be assigned, changed, calculated and other operations, this process is usually called an expression to complete, it can be said that it is a collection of variables, constants, Boolean and operators, so expressions can be divided into arithmetic expressions, string expressions, assignment expressions and Boolean expressions.
2. Operator
The functions and usage of each operator are shown in Table 2-1.
Table 2-1 operators commonly used in JavaScript
Type symbol description example result arithmetic operator-negative-3-3 * multiplication 5q315 / division 5max 522.5 take the remainder 5mod 21 + addition 51538-subtraction 5-32 | bitwise or operation 5 | 37-bitwise and operation 5x3112 ~ complement ~ 5-6string + string concatenation "A" + "B"AB" than the comparative operator = = equals to 5truth 3Falselogic = not equal to 5triple 3True3True3Truelogic operator! Logic is not! TrueFalse& logic and True & FalseFalse | logic or True | FalseTrue ^ logic XOR True ^ FalseTrue here, I believe you have a deeper understanding of "what expressions and operators does JavaScript have", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!