Hint
Same input → same output, no side effects
A pure function: (1) always returns the same output for same inputs, (2) has zero side effects.
// Pure ✅
const add = (a, b) => a + b;
// Impure ❌ — modifies external state
let total = 0;
const addToTotal = (n) => { total += n; return total; };
Pure functions are predictable, testable, and cacheable. React expects components and reducers to be pure.