mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-11 13:06:42 +00:00
add arity example
This commit is contained in:
parent
9e684fabed
commit
11387ab478
1 changed files with 17 additions and 7 deletions
24
readme.md
24
readme.md
|
|
@ -5,19 +5,29 @@
|
||||||
__Let's try and define these with examples, this is a WIP please feel free to send PR ;)__
|
__Let's try and define these with examples, this is a WIP please feel free to send PR ;)__
|
||||||
|
|
||||||
|
|
||||||
## Arity
|
## Arity
|
||||||
|
|
||||||
|
> The number of arguments a function takes.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const sum = (a, b) => a + b;
|
||||||
|
|
||||||
|
const arity = sum.length;
|
||||||
|
console.log(arity);
|
||||||
|
// => 2
|
||||||
|
// The arity of sum is 2
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Purity
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Purity
|
## Side effects
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Side effects
|
## Idempotency
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Idempotency
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue