From caf91f8d64f22df4e4908e4980c86f4ec3bf47ce Mon Sep 17 00:00:00 2001 From: Shekh Aliul Date: Sat, 3 Oct 2020 17:21:30 +0530 Subject: [PATCH] [ Fix ] typo in function name & in output | topic Higher-order functions --- readMe.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/readMe.md b/readMe.md index 49a9e48..bbeda50 100644 --- a/readMe.md +++ b/readMe.md @@ -2995,10 +2995,10 @@ Let us see were we use call back functions.For instance the _forEach_ method use ```js const numbers = [1, 2, 3, 4] -​ + const sumArray = arr => { let sum = 0 - const callBack = function(element) { + const callback = function(element) { sum += element } numbers.forEach(callback) @@ -3009,14 +3009,14 @@ console.log(sumArray(numbers)) ``` ```sh -15 +10 ``` The above example can be simplified as follows: ```js const numbers = [1, 2, 3, 4] -​ + const sumArray = arr => { let sum = 0 numbers.forEach(function(element) { @@ -3029,7 +3029,7 @@ console.log(sumArray(numbers)) ``` ```sh -15 +10 ``` ### setting time