A function is an assignment that JavaScript can take care of for you. It is a technique used to isolate a group of instructional code so that other parts of the application can depend on it to provide them with a reliable result. There are two main categories of functions you will be using in JavaScript: those that have already been created for you and those you create in your code.