Pure function
A function has to always return the same output, given the same input and a function cannot modify outside by itself and no side effects.
Every function can't be written as a pure function, because we have difference in data handling things.
It handles with,
1 Task
Predictable
Immutable state
No Shared state
Pure,
return statement
Composable
Idempotence:
The function return the same output how many time you call the function, even it is contact with outside environment. The code output is predictable.
How many times we going to call, it is going to return the same output.
Last updated