minor fixes

pull/42/head
Asabeneh 4 years ago
parent 71e978430c
commit 1152d859fd

@ -13,8 +13,8 @@
<a href="https://www.linkedin.com/in/asabeneh/" target="_blank">Asabeneh Yetayeh</a><br> <a href="https://www.linkedin.com/in/asabeneh/" target="_blank">Asabeneh Yetayeh</a><br>
<small> October, 2020</small> <small> October, 2020</small>
</sub> </sub>
</div>
</div>
[<< Day 0](../readMe.md) | [Day 2 >>](../02_Day_Introduction_to_React/02_introduction_to_react.md) [<< Day 0](../readMe.md) | [Day 2 >>](../02_Day_Introduction_to_React/02_introduction_to_react.md)
@ -2763,13 +2763,12 @@ Let us see were we use call back functions.For instance the _forEach_ method use
```js ```js
const numbers = [1, 2, 3, 4] const numbers = [1, 2, 3, 4]
const sumArray = arr => { const sumArray = arr => {
let sum = 0 let sum = 0
const callback = function(element) { const callback = function(element) {
sum += element sum += element
} }
numbers.forEach(callback) arr.forEach(callback)
return sum return sum
} }
@ -2777,7 +2776,7 @@ console.log(sumArray(numbers))
``` ```
```sh ```sh
15 10
``` ```
The above example can be simplified as follows: The above example can be simplified as follows:
@ -2787,7 +2786,7 @@ const numbers = [1, 2, 3, 4]
const sumArray = arr => { const sumArray = arr => {
let sum = 0 let sum = 0
numbers.forEach(function(element) { arr.forEach(function(element) {
sum += element sum += element
}) })
return sum return sum
@ -2797,7 +2796,7 @@ console.log(sumArray(numbers))
``` ```
```sh ```sh
15 10
``` ```
#### setting time #### setting time

@ -1082,4 +1082,4 @@ We will cover propTypes in detail in other section.
🎉 CONGRATULATIONS ! 🎉 🎉 CONGRATULATIONS ! 🎉
[<< Day 4](../04_Day_Component/04_components.md) | [Day 6 >>]() [<< Day 4](../04_Day_Component/04_components.md) | [ >>](../06_Day_Map_List_Keys/05_map_list_keys.md)

Loading…
Cancel
Save