From aba76b4b3516a874af8e35a45ef614fdb9cf34ec Mon Sep 17 00:00:00 2001 From: krantzinator Date: Wed, 11 Nov 2015 21:57:45 -0500 Subject: [PATCH] add solution for Where Do I Belong Update basic-bonfires.json --- seed/challenges/basic-bonfires.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index c1327a5c84..9fcc650e4b 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -667,7 +667,9 @@ "MDNlinks": [ "Array.sort()" ], - "solutions": [], + "solutions": [ + "function where(arr, num) {\n arr = arr.sort(function(a, b){return a-b;});\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] >= num)\n {\n return i;\n }\n }\n return arr.length;\n}" + ], "tests": [ "assert(where([10, 20, 30, 40, 50], 35) === 3, 'message: where([10, 20, 30, 40, 50], 35) should return 3.');", "assert(where([10, 20, 30, 40, 50], 30) === 2, 'message: where([10, 20, 30, 40, 50], 30) should return 2.');",