From 95a4113fc649c2e9f88f2943c06372d3e682c611 Mon Sep 17 00:00:00 2001 From: sahilkhurana02 Date: Sun, 19 Jun 2016 12:47:48 +0530 Subject: [PATCH] Further explained the challenge with a minor change. Further explained the challenge. Modified the challenge description for better understanding Reverted back previous changes and further explained the terminology. Minor change --- .../object-oriented-and-functional-programming.json | 1 + 1 file changed, 1 insertion(+) 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 ad7e1188c8..992908b0a7 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 @@ -350,6 +350,7 @@ "description": [ "The array method reduce is used to iterate through an array and condense it into one value.", "To use reduce you pass in a callback whose arguments are an accumulator (in this case, previousVal) and the current value (currentVal).", + "The accumulator is like a total that reduce keeps track of after each operation. The current value is just the next element in the array you're iterating through.", "reduce has an optional second argument which can be used to set the initial value of the accumulator. If no initial value is specified it will be the first array element and currentVal will start with the second array element.", "Here is an example of reduce being used to subtract all the values of an array:", "
var singleVal = array.reduce(function(previousVal, currentVal) {
  return previousVal - currentVal;
}, 0);
",