A genuinely different way of thinking about a program: not a sequence of steps that change things over time, but a set of functions that transform values into other values, with nothing hidden and nothing mutated behind your back. Every claim on this page is something you can watch happen, not just read about.
A pure function always returns the same output for the same input, and touches nothing outside itself. An impure function might depend on, or change, something external. Watch this proven, not asserted, call each one three times with the identical input.
A higher-order function takes another function as an argument. These three are the backbone of functional programming, watch data flow through all three stages, one at a time.
Composing two functions builds a new function that applies one, then the other. Order genuinely changes the result, verified directly below.
Many functional languages have no for-loop or while-loop at all. Every repeated action is expressed as a function calling itself with a smaller version of the problem. Watch the call stack build up, then unwind.
A lambda is a function with no name, defined right where it's used. Build one and apply it directly.