Functions
Breaking problems down into smaller, more manageable parts
A mathematical function is something that takes an input value and produces a single corresponding output. A given input always produces the same output. In computer science, functions are conceptually similar but far less strict. Functions may take input, but they also can be run without any input. Similarly, computer science functions may return a value, but they also may only perform an action without returning a specific output value.
To execute a function, its name must be "called", always with trailing () parentheses that include any input values that are being given to the function. When program’s control flow (order of execution) reaches a function call, someFunction(), it jumps to the function itself, runs the code in there, and then returns (accurate verb, eh?) to the point of the call.
While we continue development of our own educational articles, we recommend checking out this article on functions and this other article that also explains them and how to begin writing them.