Reusable blocks of code that take inputs and return outputs.
- declare with
function name(params) { ... } returnsends a value back (default is undefined)- parameters are local to the function
- functions are first-class — pass them around like values
See examples/.
Write max3(a, b, c) returning the largest.