Function

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

A javascipt finction is executed when something invokes it (calls it).

Javascript Function Syntax

A javascript function is defined with the function keyword, followed by name, folllowed by parentheses().

Function names can contain letters, digits, underscore and dollar signs(same rules as variables).

The parentheses may include parameters names separated by commas: (paraamenter 1, parameter 2)

The code to be executed, by the function is placed inside curly brackets:{} e.g function name(par1,par2,par3){ code to be executed } function parameters are the names listed in the function definition.

function arguments are the real values receive by the function when it is invoked.