Basic Syntax

Pure Function

English

Overview

A function that, given the same arguments, always returns the same result and does not modify any external state.

Details

Because it has no side effects—such as rewriting a variable outside its scope or reading/writing a file—its result never depends on execution order or timing, making it easier to test and debug. It's a central concept in functional programming.

More Programming terms