From 740b26a07d61c10433077de19921582263f77296 Mon Sep 17 00:00:00 2001 From: Kristyn Bryan Date: Mon, 23 May 2016 15:55:47 -0400 Subject: [PATCH] Update Solutions_w02d02_morning_exercise.md --- .../Solutions_w02d02_morning_exercise.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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..c5d1748 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 -![Cat Programmer](http://s2.quickmeme.com/img/99/9903c7c14add3fd0758b7b5b80c24d48101f296f13ce34736799a82c71f61bc2.jpg) - - - # JAVASCRIPT ITERATORS #####`.forEach`, `.map`, and `.reduce` @@ -26,7 +22,16 @@ arr.forEach(function(n) { => Prints a bunch of 9s to the console ``` +
+SOLUTION to .forEach + +```javascript +words = ["Ho", "Chi", "Minh", "City", "was", "once", "known", "as", "Prey", "Nokor"]; +words.forEach(function (e){ + console.log(e.toUpperCase()); +}); +``` ##### EXERCISE: - Log each word in `words` in upper case using `.forEach.`