diff --git a/unit_01/w02d02/morning_exercise/README.md b/unit_01/w02d02/morning_exercise/README.md index ebfd50a..303599c 100644 --- a/unit_01/w02d02/morning_exercise/README.md +++ b/unit_01/w02d02/morning_exercise/README.md @@ -78,6 +78,8 @@ Expected result: Add together all numbers in an array: ``` +arr = [8, 8, 8, 8, 8, 8, 8, 8]; + new_value = arr.reduce(function(sum, n){ return sum += n }); @@ -91,7 +93,7 @@ new_value = arr.reduce(function(sum, n){ arr = [8, 8, 8, 8, 8, 8, 8, 8]; ``` -- Return the product of the numbers in `arr`. +- Return the *product* of the numbers in `arr`. diff --git a/unit_01/w02d02/morning_exercise/Solutions_w02d02_morning_exercise.md b/unit_01/w02d02/morning_exercise/Solutions_w02d02_morning_exercise.md index 8df6b6a..f3d85e4 100644 --- a/unit_01/w02d02/morning_exercise/Solutions_w02d02_morning_exercise.md +++ b/unit_01/w02d02/morning_exercise/Solutions_w02d02_morning_exercise.md @@ -1,9 +1,5 @@ # W02D02 Morning Warmup - - - - # JAVASCRIPT ITERATORS #####`.forEach`, `.map`, and `.reduce` @@ -27,7 +23,6 @@ arr.forEach(function(n) { ``` - ##### EXERCISE: - Log each word in `words` in upper case using `.forEach.` @@ -35,8 +30,16 @@ arr.forEach(function(n) { words = ["Ho", "Chi", "Minh", "City", "was", "once", "known", "as", "Prey", "Nokor"]; ``` +