From 0221259765632a217dcaef8c2a9ca7c6851999cc Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 4 Jul 2016 18:48:43 -0500 Subject: [PATCH] Updated Code Example for Iterate Over Arrays w Map --- .../object-oriented-and-functional-programming.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/object-oriented-and-functional-programming.json b/seed/challenges/01-front-end-development-certification/object-oriented-and-functional-programming.json index f80a377680..e5575c1b51 100644 --- a/seed/challenges/01-front-end-development-certification/object-oriented-and-functional-programming.json +++ b/seed/challenges/01-front-end-development-certification/object-oriented-and-functional-programming.json @@ -305,7 +305,7 @@ "title": "Iterate over Arrays with .map", "description": [ "The map method is a convenient way to iterate through arrays. Here's an example usage:", - "
var timesFour = oldArray.map(function(val){
  return val * 4;
});
", + "
var oldArray = [1, 2, 3];
var timesFour = oldArray.map(function(val){
  return val * 4;
});
console.log(timesFour); // returns [4, 8, 12]
console.log(oldArray); // returns [1, 2, 3]
", "", "The map method will iterate through every element of the array, creating a new array with values that have been modified by the callback function, and return it. Note that it does not modify the original array.", "In our example the callback only uses the value of the array element (the val argument) but your callback can also include arguments for the index and array being acted on.",