From 84613ac864644f52042ec0899410d009b3a2b6be Mon Sep 17 00:00:00 2001 From: DealPete Date: Fri, 10 Jun 2016 19:30:04 -0230 Subject: [PATCH] Fixed 'Write Reusable JavaScript with Functions' head and tail --- .../basic-javascript.json | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json index 7ac5e11aca8..387ffc24494 100644 --- a/challenges/01-front-end-development-certification/basic-javascript.json +++ b/challenges/01-front-end-development-certification/basic-javascript.json @@ -2041,19 +2041,7 @@ "

Instructions

", "
  1. Create a function called reusableFunction which prints \"Hi World\" to the dev console.
  2. Call the function.
" ], - "challengeSeed": [ - "// Example", - "function reusableFunction() {", - " console.log(\"Heyya, World\");", - "}", - "", - "reusableFunction();", - "", - "// Only change code below this line", - "", - "" - ], - "tail": [ + "head": [ "var logOutput = \"\";", "var originalConsole = console", "function capture() {", @@ -2073,12 +2061,26 @@ " console.log = originalConsole.log;", "}", "", + "capture();" + ], + "challengeSeed": [ + "// Example", + "function reusableFunction() {", + " console.log(\"Heyya, World\");", + "}", + "", + "reusableFunction();", + "", + "// Only change code below this line", + "", + "" + ], + "tail": [ + "uncapture();", + "", "if (typeof reusableFunction !== \"function\") { ", " (function() { return \"reusableFunction is not defined\"; })();", "} else {", - " capture();", - " reusableFunction(); ", - " uncapture();", " (function() { return logOutput || \"console.log never called\"; })();", "}" ],