// BASIC FUNCTION DEFINITION WITH NO PARAMETERS:
function yourFunctionName() {
// a bunch of code to do stuff
}
// FUNCTION DEFINITION WITH PARAMETERS:
function yourFunctionName(p1,p2,p3) {
// abunch of code
}
// FUNCTION DEFINITION WITH PARAMETERS AND A RETURN VALUE:
function yourFunctionName(p1,p2,p3) {
return yourValue;
}
Example: