Creating Functions in JS

Intro

Functions are (at their simplest form) collections of statements that may be run as a group at a later time. These can be useful as they allow developers to reuse code and break larger problems down into simpler ones.

Note: Functions are first-class objects in JavaScript, and so can be treated just as any other object that you might use.