Functional Programming - Arity
Programming
Functional Programming
Arity
The number of parameters a function consumes is called as the Arity of that function.
The arity of the add function below is two since it uses two parameters.
function add(a, b) {
return a + b;
}A function that accepts single parameter is unary, the one that accepts two parameters is binary, three is ternary and n paramters is n-ary.