Function closures
A closure is a function that captures variables from the scope around it. The function can read and update those variables — and they persist between calls.
In the example, adder returns a closure that accumulates into its own sum. Each call to adder() creates an independent closure with its own sum.
Try it: Notice that pos and neg each have separate state — they don’t share sum.