Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6fbdea2

Browse filesBrowse files
committed
Korian Day 1 has been added
1 parent e14526c commit 6fbdea2
Copy full SHA for 6fbdea2

4 files changed

+4,907-31Lines changed: 4907 additions & 31 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎09_Day_Higher_order_functions/09_day_higher_order_functions.md‎

Copy file name to clipboardExpand all lines: 09_Day_Higher_order_functions/09_day_higher_order_functions.md
+27-29Lines changed: 27 additions & 29 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,29 @@
1919
![Day 5](../images/banners/day_1_9.png)
2020

2121
- [Day 9](#day-9)
22-
- [Higher Order Function](#higher-order-function)
23-
- [Callback](#callback)
24-
- [Returning function](#returning-function)
25-
- [setting time](#setting-time)
26-
- [setInterval](#setinterval)
27-
- [setTimeout](#settimeout)
28-
- [Functional Programming](#functional-programming)
29-
- [forEach](#foreach)
30-
- [map](#map)
31-
- [filter](#filter)
32-
- [reduce](#reduce)
33-
- [every](#every)
34-
- [find](#find)
35-
- [findIndex](#findindex)
36-
- [some](#some)
37-
- [sort](#sort)
38-
- [Sorting string values](#sorting-string-values)
39-
- [Sorting Numeric values](#sorting-numeric-values)
40-
- [Sorting Object Arrays](#sorting-object-arrays)
41-
- [💻 Exercises](#-exercises)
42-
- [Exercises: Level 1](#exercises-level-1)
43-
- [Exercises: Level 2](#exercises-level-2)
44-
- [Exercises: Level 3](#exercises-level-3)
22+
- [Higher Order Function](#higher-order-function)
23+
- [Callback](#callback)
24+
- [Returning function](#returning-function)
25+
- [Setting time](#setting-time)
26+
- [Setting Interaval using a setInterval function](#setting-interaval-using-a-setinterval-function)
27+
- [Setting a time using a setTimeout](#setting-a-time-using-a-settimeout)
28+
- [Functional Programming](#functional-programming)
29+
- [forEach](#foreach)
30+
- [map](#map)
31+
- [filter](#filter)
32+
- [reduce](#reduce)
33+
- [every](#every)
34+
- [find](#find)
35+
- [findIndex](#findindex)
36+
- [some](#some)
37+
- [sort](#sort)
38+
- [Sorting string values](#sorting-string-values)
39+
- [Sorting Numeric values](#sorting-numeric-values)
40+
- [Sorting Object Arrays](#sorting-object-arrays)
41+
- [💻 Exercises](#-exercises)
42+
- [Exercises: Level 1](#exercises-level-1)
43+
- [Exercises: Level 2](#exercises-level-2)
44+
- [Exercises: Level 3](#exercises-level-3)
4545

4646
# Day 9
4747

@@ -54,12 +54,12 @@ Higher order functions are functions which take other function as a parameter or
5454
A callback is a function which can be passed as parameter to other function. See the example below.
5555

5656
```js
57-
// a callback function, the function could be any name
57+
// a callback function, the name of the function could be any name
5858
const callback = (n) => {
5959
return n ** 2
6060
}
6161
62-
// function take other function as a callback
62+
// function that takes other function as a callback
6363
function cube(callback, n) {
6464
return callback(n) * n
6565
}
@@ -71,7 +71,6 @@ console.log(cube(callback, 3))
7171

7272
Higher order functions return function as a value
7373
74-
7574
```js
7675
// Higher order function returning an other function
7776
const higherOrder = n => {
@@ -90,7 +89,6 @@ Let us see were we use call back functions. For instance the _forEach_ method us
9089

9190
```js
9291
const numbers = [1, 2, 3, 4]
93-
9492
const sumArray = arr => {
9593
let sum = 0
9694
const callback = function(element) {
@@ -354,8 +352,8 @@ const scores = [
354352
{ name: 'John', score: 100 },
355353
]
356354

357-
const scoresGreaterEight = scores.filter((score) => score.score > 80)
358-
console.log(scoresGreaterEight)
355+
const scoresGreaterEighty = scores.filter((score) => score.score > 80)
356+
console.log(scoresGreaterEighty)
359357
```
360358

361359
```sh

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.