My reading notes
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 pc runs across the (frequent) structures that change the control flow, such as conditionals and loops
Example below
if (field==empty) {
promptUser();
} else {
submitForm();
}
Control flow means that when you read a script, you must not only read from start to finish but also look at program structure and how it affects order of execution.
A JS function is a block of code thatis designed to perform a task
JS Function Syntax
function name(parameter1, parameter2, parameter3) {
// code to be executed
}
Inside the function the arguments (the parameters) behave as local variables
Function Invocation
return
statement, the function will stop executingOperator Description
+
Addition
-
Subtraction
*
Multiplication
**
Exponentiation (ES2016)
/
Division
%
Modulus (Division Remainder)
++
Increment
--
Decrement
Operator, Example, Same As =,x = y, x = y
+=, x += y, x = x + y
-=, x -= y, x = x - y
*=, x *= y, x = x * y
/=, x /= y, x = x / y
%=, x %= y, x = x % y
**=, x **= y, x = x ** y