The number of parameters a function takes.
A function which takes two parameters, or is said to have an arity of 2.
A combinator is a primitive higher-order function without free-variables . Often if you can identify combinators in your code, you can use them to simplify logical parts of the code because of a knowledge of certain morphisms . Read much more on wikipedia . (The above definitions provided by this gist .) (A common reference is To Mock A Mockingbird but your mileage may vary.) There's a lot more to read…
An operation which takes two or more functions and returns a unary function. Function composition facilitates code re-use.
The constant function takes what it is given and returns a nullary function which returns the original value. Sometimes called always or the K combinator.
Currying is a way of modifying a given function which takes multiple arguments in
to a sequence of unary functions. Specifically, in JS, it means that you can manipulate arguments, their order, and other facets of a passed in function. Modules
A function which will always return the same output given the same input. As a feature of this, these functions are referentially transparent : That was a simple example but this maxim holds true no matter how complex the nested complexity gets. See this review for more examples.
A free-variable is a global variable or variable defined externally to the function. You can use the free-variable partial-application pattern to fix this problem and turn this function pure : If the above seems overkill, or needless, just remember that a runtime error can crash everything in JS land and a free benefit of the pattern is that you get the ability to inject mocks into your tests (e.g. const save…
A relationship or expression involving one or more variables.
A function which takes a function and possible additional parameters, and returns a function.
The identity function returns what it is given. Sometimes referenced as the I combinator.
A function which takes zero parameters, or is said to have an arity of 0.
A pure function is deterministic , has no side-effects and is referentially transparent .
A function which (when invoked with all inputs) can be replaced in all instances without changing the program's behavior.
A side-effect is something which is external to the body of the current function (often in the form of a function call whose value is not captured).
A function which takes three parameters, or is said to have an arity of 3.
A function which takes one parameter, or is said to have an arity of 1.