CodeIntermediate

Pure function

Also known as purity

A function whose result depends only on its inputs and that has no observable side effects.

In the real world

A function that adds two numbers without changing other state is pure.

Related

Go a little deeper