diff --git a/09_Day_Higher_order_functions/09_day_higher_order_functions.md b/09_Day_Higher_order_functions/09_day_higher_order_functions.md index 3c8a619..c09e0a3 100644 --- a/09_Day_Higher_order_functions/09_day_higher_order_functions.md +++ b/09_Day_Higher_order_functions/09_day_higher_order_functions.md @@ -97,7 +97,7 @@ const sumArray = arr => { const callBack = function(element) { sum += element } - numbers.forEach(callback) + arr.forEach(callback) return sum } @@ -115,7 +115,7 @@ const numbers = [1, 2, 3, 4] ​ const sumArray = arr => { let sum = 0 - numbers.forEach(function(element) { + arr.forEach(function(element) { sum += element }) return sum diff --git a/11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md b/11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md index 5f0e896..d33a37e 100644 --- a/11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md +++ b/11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md @@ -57,7 +57,7 @@ Destructuring is a way to unpack arrays, and objects and assigning to a distinct ```js const names = ['Asabeneh', 'Brook', 'David', 'John'] - let [firstPerson, secondPerson, thirdPerson, fourth Person] = names + let [firstPerson, secondPerson, thirdPerson, fourthPerson] = names console.log(firstName, secondPerson,thirdPerson, fourthPerson) ``` @@ -209,7 +209,7 @@ const rectangle = { height: 10, area: 200 } -let { width: w, heigh: h, area: a, perimeter: p } = rectangle +let { width: w, height: h, area: a, perimeter: p } = rectangle console.log(w, h, a, p) ``` @@ -226,7 +226,7 @@ const rectangle = { height: 10, area: 200 } -let { width, heigh, area, perimeter = 60 } = rectangle +let { width, height, area, perimeter = 60 } = rectangle console.log(width, height, area, perimeter) //20 10 200 60 //Lets modify the object:width to 30 and perimeter to 80 @@ -239,7 +239,7 @@ const rectangle = { area: 200, perimeter: 80 } -let { width, heigh, area, perimeter = 60 } = rectangle +let { width, height, area, perimeter = 60 } = rectangle console.log(width, height, area, perimeter) //20 10 200 80 ```