This expression uses the operator to add 3 and 4 together and produces a value, 7. The expression 3 4 is an example of the second type. This expression uses the = operator to assign the value seven to the variable x. The expression x = 7 is an example of the first type. There are two types of expressions: those that have side effects (such as assigning values) and those that purely evaluate. This chapter describes JavaScript's expressions and operators, including assignment, comparison, arithmetic, bitwise, logical, string, ternary and more.Īt a high level, an expression is a valid unit of code that resolves to a value.
0 Comments
Leave a Reply. |