mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-11 04:56:40 +00:00
Purity.
This commit is contained in:
parent
5a836308db
commit
e5fd793982
1 changed files with 10 additions and 1 deletions
|
|
@ -64,7 +64,16 @@ curriedSum(40)(2) // 42.
|
||||||
---
|
---
|
||||||
|
|
||||||
## Purity
|
## Purity
|
||||||
|
> A function is said to be pure if the return value is only determined by its
|
||||||
|
input values, without any side effects.
|
||||||
|
|
||||||
|
```js
|
||||||
|
let greet = "yo";
|
||||||
|
|
||||||
|
greet.toUpperCase(); // YO;
|
||||||
|
|
||||||
|
greet // yo;
|
||||||
|
```
|
||||||
---
|
---
|
||||||
|
|
||||||
## Side effects
|
## Side effects
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue