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.
Glossary: Refactoring and Clean Code
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.