View on GitHub

reading-notes

Control flow

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.

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. *

for mre about control flow

JavaScript Functions

A JavaScript function is a block of code designed to perform a particular task.

A Function is much the same as a Procedure or a Subroutine, in other programming languages.

The code inside the function will execute when “something” invokes (calls) the function:

When JavaScript reaches a return statement, the function will stop executing.

If the function was invoked from a statement, JavaScript will “return” to execute the code after the invoking statement.

Functions often compute a return value. The return value is “returned” back to the “caller”

# Why Functions?

You can reuse code: Define the code once, and use it many times.

You can use the same code many times with different arguments, to produce different results.

### for more about function

# JavaScript Operators

for more about Operator