Functions are declared at the beginning of the program. They are called by typing the function name, followed by parenthesis. Functions can be passed parameters when they are called. Putting a value, or expression within the functions parenthesis will pass that value to the function. Additional values can be passed by adding commas.
Some functions return values that are used by the main program.
They do this by using the return statement. Functions that do not explicitly return a value return an undefined value, so if you want a function to return something, you need to remember to explicitly tell it to. Each function can have its own local variables that exist only while the function is being used. There are also some predefined functions that are explained later. They behave just like functions you would write.