Samaritan's Purse

FUNCTIONS

Functions are a pieces of code that execute when called.

They allow code to be written once and used many times.

Information may, or may not, be passed to the function and information may, or may not, be returned from the function.

SYNTAX

function name(variable1, variable2, ...)
{
  code
}

EXAMPLES

NO PASS | NO RETURN

NO PASS | RETURN

PASS | NO RETURN

PASS | RETURN

Mozilla Developer Network