Skip to content

Instantly share code, notes, and snippets.

@sorinpav
Last active April 21, 2020 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sorinpav/fc658eeef345cbc4b271696a29629fe6 to your computer and use it in GitHub Desktop.
Save sorinpav/fc658eeef345cbc4b271696a29629fe6 to your computer and use it in GitHub Desktop.
What a pure function is
const addNumbers(a,b) => return num + a + b;
//Pure functions def: A function which returns the exact same result every time, when given the exact same arguments.
//I.e. a function is NOT pure when the same arguments might give different outputs (i.e. imagine making API calls
//and getting 'num' from above through an API call, which in turn means the num value might be different, since
//the data fetched from the API might be different.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment