From c77f9fb606c5774ec806d1d9b0b5ce7c31ae8b37 Mon Sep 17 00:00:00 2001 From: Jon Woo Date: Wed, 4 Oct 2017 18:39:54 -0500 Subject: [PATCH] changed stuff --- src/services/array-functions.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/services/array-functions.js b/src/services/array-functions.js index ff781d2..c55ab42 100644 --- a/src/services/array-functions.js +++ b/src/services/array-functions.js @@ -5,7 +5,13 @@ //add the returned value from fnc to the new array //return the new array export function map(theArray, fnc){ - + var newArray = []; + for(var i = 0 ; i < theArray.length; i++){ + var currentItem = theyArray[i]; + var returneditem = fnc(currentItem); + newArray[i]= (returneditem); + } + return newArray; } //create a new array