mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-06 02:26:43 +00:00
arity
This commit is contained in:
parent
80ba9ff8c1
commit
745cfc6eee
1 changed files with 4 additions and 4 deletions
|
|
@ -87,12 +87,12 @@ __Table of Contents__
|
|||
|
||||
The number of arguments a function takes. From words like unary, binary, ternary, etc.
|
||||
|
||||
```js
|
||||
const sum = (a, b) => a + b
|
||||
```go
|
||||
sum := func (a, b int) { return a + b}
|
||||
// The arity of sum is 2 (binary)
|
||||
const inc = a => a + 1
|
||||
inc := func (a int) { return a + 1}
|
||||
// The arity of inc is 1 (unary)
|
||||
const zero = () => 0
|
||||
zero := func () { return 0}
|
||||
// The arity of zero is 0 (nullary)
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue