About Using Functions
Functions are a key building block for writing programs in Javascript.
Functions allow you to isolate just about any programming steps that might need repeating. For example updating changed profile information on the screen or to request profile data saved in a database on the server.
A function is one or more lines of code that can optionally have one or more input values and optionally become an output value.
A function's code is dormant until the function is requested by other lines of code.
Terms used to describe this process are invoking or calling the function. It means that other lines of code are branching into the function's code until completed. You also might hear call the function, execute the function and run the function.
There are two ways to define a function. You can use a function declaration or a function expression.