Before You Start: The Words This Series Keeps Using
The handful of terms this Functional-Light JavaScript series uses constantly: function, procedure, side effect, pure function, surface area, confidence. Explained once in plain language.
This series teaches functional programming in JavaScript, one idea at a time, starting from what actually makes something a function at all. It assumes you can already write basic JavaScript. It does not assume you already know any functional programming vocabulary.
This page exists to close that gap. Read it once before starting, or come back any time a word shows up later and doesn't immediately click. Simplifying the sentences around a word is not the same as skipping the word, this series keeps the real terms on purpose, because they're exactly what you'd use to explain your code to someone else later.
The Words This Series Uses Constantly
Function
A piece of code that takes some input and gives back an output, using only what it was handed. Nothing sneaks in, nothing leaks out. If you give it the same input twice, you get the same output twice, always.
Procedure
A named block of code that does something, but doesn't cleanly hand back a value the way a function does. Printing something to the screen, saving something to a file, these are procedures. Procedures aren't wrong or bad, a program needs them, they're just a different thing from a function.
Side Effect
Anything a piece of code does that reaches outside itself: changing a variable it wasn't handed, printing to a screen, saving to a database, checking the time. A real function isn't allowed to have any. The first post that explains this in full.
Side Cause
The other direction of a side effect: instead of reaching out, code reaches in and reads something it wasn't handed, like a variable sitting outside the function. Most people just call both directions "side effects."
Pure Function
A function with no side effects and no side causes at all. Same input in, same output out, every single time, no exceptions. This is the actual goal this whole series is working toward.
Surface Area
How many spots in your code could possibly change a given value. A value with a small surface area (like a variable only one small function ever touches) is easy to trust. A value with a huge surface area (like a variable the entire program can reach) is much harder to trust, because there are so many places it could quietly change.
Confidence (Level of)
Whether a function call is pure isn't always a clean yes or no in real code, sometimes you just can't see everything that could affect it. So instead of demanding a verdict, this series asks how confident you are, and works to make that confidence as high as possible.
Parameter vs Argument
A parameter is the name written into a function's own definition (x in function f(x)). An argument is the actual value handed over when the function is called (5 in f(5)). Arguments get assigned to parameters.
Function Shape
An informal way of describing how many inputs a function takes and how many outputs it gives back. A unary function takes one input, a binary function takes two, and an n-ary function takes three or more. Functions with matching shapes fit together easily; mismatched shapes need an adapter in between.
Higher-Order Function
A function that takes another function as an input, gives one back as an output, or both. unary, binary, flip, and apply are all higher-order functions: each takes a function in and hands a new, reshaped function back.
Variadic
A property of every JavaScript function: it can be called with any number of arguments, no matter how many parameters it declares. Extra arguments are silently ignored, missing ones just come through as undefined.
Point-Free Style
Defining a function without ever naming its input. const isEven = not(isOdd) never mentions the value being checked; the input, called a "point" in math, stays invisible.
Equational Reasoning
Noticing that two functions have the same shape and treating them as interchangeable because of it, even though they do different things. This is the actual technique behind point-free style.
Predicate
A function whose whole job is answering a yes-or-no question, returning true or false. isEven, qualifiesForBulk, and isEligibleForFreeShipping are all predicates.
Composition
Feeding one function's output directly into another function's input, so the two behave like one combined step. compose(gte(50), getSubtotal) runs getSubtotal first, then hands its result straight to gte(50).
Closure
When a function remembers a variable from the scope it was defined in, even after that outer function has already finished running. Closure is neutral about purity, it's just memory. A closure over a value that never changes stays pure; a closure over something that changes on every call, like a counter, does not. Full explanation.
Partial Application / Currying
Giving a function some of its inputs now, and getting back a new function that remembers them and waits for the rest. You've already seen this technique used in this series, this series comes back to name it properly and explain it in full later.
Keep this page open in another tab for the first few posts. Once these words stop needing a second look, you won't need it anymore.
Keep reading