Pure functions

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

Read More