Skip to content

Glossary: Refactoring and Clean Code

Pure function

Also written: pure functions

A function whose result depends only on its parameters and that changes nothing outside itself. `subtotal` and `shipping_cost` are pure, so they're easy to test.

Where the book teaches it

Related terms

Side effect