Pure function
Program function without side effects and which returns identical values for identical arguments / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Pure function?
Summarize this article for a 10 year old
SHOW ALL QUESTIONS
In computer programming, a pure function is a function that has the following properties:[1][2]
- the function return values are identical for identical arguments (no variation with local static variables, non-local variables, mutable reference arguments or input streams), and
- the function has no side effects (no mutation of local static variables, non-local variables, mutable reference arguments or input/output streams).
Program function without side effects and which returns identical values for identical arguments
Some authors, particularly from the imperative language community, use the term "pure" for all functions that just have the above property 2[3][4] (discussed below).
Oops something went wrong: