Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 371 Bytes

arity.md

File metadata and controls

14 lines (9 loc) · 371 Bytes

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.