From 05df2649dec0d6745fa9f2805172712dcdd8e311 Mon Sep 17 00:00:00 2001 From: "Alister N. Mada" Date: Thu, 14 Jan 2016 12:14:58 +0700 Subject: [PATCH] Fix bug on Waypoint: Iterate Through an Array with a For Loop Conditions needed to pass the tests weren't showing. Problem was that the variable `total` was passed before it could be defined. Rewrote tail to fix. closes #6137 --- .../basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index 80e54a4459..a80b54501e 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -3875,7 +3875,7 @@ "" ], "tail": [ - "(function(t) { if(typeof t !== 'undefined') { return \"Total = \" + t; } else { return \"Total is undefined\";}})(total);" + "(function(){if(typeof total !== 'undefined') { return \"total = \" + total; } else { return \"total is undefined\";}})()" ], "solutions": [ "var myArr = [ 2, 3, 4, 5, 6];\nvar total = 0;\n\nfor (var i = 0; i < myArr.length; i++) {\n total += myArr[i];\n}"