From 8431830af604c5cce26b2a41e1e3d4356890017e Mon Sep 17 00:00:00 2001 From: tommy Date: Mon, 26 Jun 2017 16:28:24 -0700 Subject: [PATCH] fix/Clarification for code example Clarification needed for Functional Programming code example, in the challenge Add Elements to the End of an Array Using concat Instead of push --- .../functional-programming.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/functional-programming.json b/seed/challenges/02-javascript-algorithms-and-data-structures/functional-programming.json index 0e16b593949..bf2b173c479 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/functional-programming.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/functional-programming.json @@ -831,7 +831,7 @@ "description": [ "Functional programming is all about creating and using non-mutating functions.", "The last challenge introduced the concat method as a way to combine arrays into a new one without mutating the original arrays. Compare concat to the push method. Push adds an item to the end of the same array it is called on, which mutates that array. Here's an example:", - "
var arr = [1, 2, 3];
arr.push([4, 5, 6]);
// arr is changed to [1, 2, 3, 4, 5, 6]
// Not the functional programming way
", + "
var arr = [1, 2, 3];
arr.push([4, 5, 6]);
// arr is changed to [1, 2, 3, [4, 5, 6]]
// Not the functional programming way
", "Concat offers a way to add new items to the end of an array without any mutating side effects.", "
", "Change the nonMutatingPush function so it uses concat to add newItem to the end of original instead of push. The function should return an array."