DEV Community

Calvin
Calvin

Posted on

Reading Snippets [10]

Pure functions are functions that satisfy two conditions:

  • Deterministic
  • No Side Effects

They are deterministic which means that they will always return the same output for any given input. They also do not have side effects which means they cannot change global variables.

Not only do pure functions not have side effects but also pure functions do not rely on code that has side effects. They always give the same return value for the same input parameters.

Top comments (0)