JavaScript’s syntax expressions and operators, including assignment, comparison, arithmetic, bitwise, logical, string, ternary and more.
JavaScript has the following types of operators:
3+4 or x*y.
x = y
(+), subtraction (-)multiplication
a & b
&& and ||
'my ' + 'string'
condition ? val1 : val2
delete
typeof
in
instanceof
## Operator precedence The precedence of operators determines the order they are applied when evaluating an expression. You can override operator precedence by using parentheses.
## Expressions An expression is any valid unit of code that resolves to a value.
For example : x = 7
.
## Adding Strings and Numbers:
Example:
var x = 5 + 5;
The control flow is the order in which the computer executes statements in a script.
Code is run in order from the first line in the file to the last line, unless the computer runs across the (extremely frequent) structures that change the control flow, such as conditionals and loops.
including conditionals, loops and functions. Parts of a script may also be set to execute when events occur.