IT lexicon Programming Pure function

Pure function

Programming På svenska → Updated: 2026-05-23

A function that always returns the same output for the same input and has no side effects.

Easy to test, cache, parallelise, debug. function add(a, b) { return a + b } is pure. function save(x) { db.write(x) } is not. Central to functional programming.

← Back to the lexicon