Pure functions are called pure because:
The result is then predictable.
Pure functions take data and transform it, without modifying any shared state, meaning there are no side effects besides returning a value.
They are mostly used in functional programming.
function sum(a, b) {
return a + b;
}
function withdraw(account, amount) {
account.total -= amount;
}
A pure expression is an expression that declares data and transform it with functions.
Impurities are language constructs that are not reproducible.
Pure functional data structures - Purely Functional Data Structures - Chris Okasaki - September 1996 - CMU-CS-96-177 (PDF)