Function

A function is some amount of code you can reuse in your program. You create a function using a function definition which names the function and has its code. A function call is when you use a function by its name somewhere in your program.

Defining a function

A function definition is a block that has the name of the function and its code.

function doSomething() {
}

Calling a function

A function call is when you want to use the code in the function at some place in your program.

function doSomething() {
}
doSomething();

See also

define, call