JavaScript functions are defined with the function
keyword.
You can use a function declaration or a function expression.
Function Declarations
Earlier in this tutorial, you learned that functions are declared with the following syntax:
function functionName(parameters) {
// code to be executed
}
Declared functions are not executed immediately. They are “saved for later use”, and will be executed later, when they are invoked (called upon). Continue reading JavaScript Function Definitions