From 90b2b6bb9e67757c503abb597ab7e83af1643acd Mon Sep 17 00:00:00 2001 From: David Trinh Date: Mon, 20 Oct 2014 17:23:52 -0700 Subject: [PATCH] Update 22meanmode.js add closing ] on line 9. --- 22meanmode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/22meanmode.js b/22meanmode.js index 99d261e..a88f8bb 100644 --- a/22meanmode.js +++ b/22meanmode.js @@ -6,7 +6,7 @@ function MeanMode(arr) { for ( var i = 0; i < arr.length; i++ ) { //cycling through the array of numbers sum += arr[i]; //adding numbers together for the full sum - modeCount[arr[i]] = modeCount[arr[i] || 0; //initialzing a key value pair or using the current one if we've seen the number before + modeCount[arr[i]] = modeCount[arr[i]] || 0; //initialzing a key value pair or using the current one if we've seen the number before modeCount[arr[i]] += 1; //adding for the count of the number } mean = sum/arr.length; //calculating the mean value @@ -17,4 +17,4 @@ function MeanMode(arr) { } } return mode === mean; //check to see if the mode and mean are equal -} \ No newline at end of file +}