A pure function is a function which:
Given the same input, always returns the same output and the Produces have no side effects.
Preoperties
- No random values
- No current date/time
- No global state
- No mutation of parameters
Benefits
- Self-documenting
- Easily testable
What are your thoughts on this post?
I’d love to hear from you! Click this link to email me, I reply to every message!
Also use the share button below if you liked this post. It makes me smile, when I see it.