A function allows you to process data on demand. For example, on the site sandbox.sketch99.com, we use javascript functions to allow visitors to change the color of text by calling a function and passing it the user’s desired color as an argument.

A function looks something like this:

function myfunction(){}

The word function tells the computer that the information to follow is in fact a function.

The next item “myfunction” is the name of the function. Each function has a “basket” which is used to specify what, if anything, can be passed as arguments to the function.

Inside the curly brackets is the action. This is what the function is doing.