From 7272245b62242b1cfa801cef418a921c66eb8ac6 Mon Sep 17 00:00:00 2001 From: Kristyn Bryan Date: Mon, 23 May 2016 16:58:27 -0400 Subject: [PATCH] Update Solutions_w02d02_morning_exercise.md --- .../Solutions_w02d02_morning_exercise.md | 9 +++++++++ 1 file changed, 9 insertions(+) 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 3fd0947..7b263b1 100644 --- a/unit_01/w02d02/morning_exercise/Solutions_w02d02_morning_exercise.md +++ b/unit_01/w02d02/morning_exercise/Solutions_w02d02_morning_exercise.md @@ -107,7 +107,16 @@ arr = [8, 8, 8, 8, 8, 8, 8, 8]; - Return the product of the numbers in `arr`. +SOLUTION .reduce +```javascript +arr = [8, 8, 8, 8, 8, 8, 8, 8]; +new_value = arr.reduce(function(product, n){ + return product *= n +}); + +console.log(new_value); +``` ...