A function is a series of commands that performs an action or computes a value. A function consists of the function name, which identifies it; parameters, which are values used by the function; and a series of commands that are run when the functions is called. Not all functions require parameters. The general syntax of a JavaScript function is: