Skip to content

Commit f12649b

Browse files
authored
Add Pure function Def
1 parent 0b4650a commit f12649b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ One place JavaScript!
88
- [Callback/ Higher-order Function](#callback)
99
- [Promises](#promises)
1010
- [Closures](#closures)
11+
- [Pure functions](#pure)
1112
- [Splice vs Slice vs Split](#diffs)
1213
- [Data Types](#datatypes)
1314
- [DOM](#dom)
@@ -118,6 +119,17 @@ function outerFunction () {
118119
outerFunction()() // I see the outer variable!
119120
```
120121

122+
123+
<a name=“pure”/>
124+
125+
#### Pure functions
126+
127+
A Pure functions doesn't depend on and doesn't modify the states of the variable out of its scope.
128+
Technically, that means a pure function always returns same results given same parameters.
129+
Its execution doesn't depends on the state of the system.
130+
Pure functions are the piller of the Functional Programming
131+
132+
121133
<a name=“sdiff”/>
122134

123135
#### Splice vs Slice vs Split

0 commit comments

Comments
 (0)