From 35e38d61b8f83f70f6b417a5d450e715d74f0cea Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Sat, 2 Apr 2016 01:28:35 -0700 Subject: [PATCH] Clarify instructions for Local Scope and Functions - Add additional instructions on following commented out instructions - Add hint to refresh page if you encounter issues - Lint the head script to follow two space indent - Capitalize words in commented out instructions --- .../basic-javascript.json | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) 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 ceb80d0d3b8..f815daf1cdd 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -2264,23 +2264,24 @@ "
function myTest() {
var loc = \"foo\";
console.log(loc);
}
myTest(); // \"foo\"
console.log(loc); // \"undefined\"
", "loc is not defined outside of the function.", "

Instructions

", - "Declare a local variable myVar inside myFunction" + "Declare a local variable myVar inside myFunction. Run the tests and then follow the instructions commented out in the editor.", + "Hint
Refreshing the page may help if you get stuck." ], "releasedOn": "January 1, 2016", "head": [ "var logOutput = \"\";", "var originalConsole = console", "function capture() {", - " var nativeLog = console.log;", - " console.log = function (message) {", - " logOutput = message;", - " if(nativeLog.apply) {", - " nativeLog.apply(originalConsole, arguments);", - " } else {", - " var nativeMsg = Array.prototype.slice.apply(arguments).join(' ');", - " nativeLog(nativeMsg);", - " }", - " };", + " var nativeLog = console.log;", + " console.log = function (message) {", + " logOutput = message;", + " if(nativeLog.apply) {", + " nativeLog.apply(originalConsole, arguments);", + " } else {", + " var nativeMsg = Array.prototype.slice.apply(arguments).join(' ');", + " nativeLog(nativeMsg);", + " }", + " };", "}", "", "function uncapture() {", @@ -2297,11 +2298,11 @@ "}", "myFunction();", "", - "// run and check the console ", + "// Run and check the console", "// myVar is not defined outside of myFunction", "console.log(myVar);", "", - "// now remove the console log line to pass the test", + "// Now remove the console log line to pass the test", "" ], "tail": [