JavaScript - Functions
What is a “Function”?
- A series of statemnets that performs a specific task that can be reused several times.
Function Declaring - The Syntax:
- function function name { Block of statements to be executed return statement “Optional” }
Calling a Function - The Syntax:
- function name (paramneters”input” “Optional”);
Note:
- Make sure to declare the variables used with in the function.