diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json
index 995b730772..ebe63ec6cf 100644
--- a/challenges/01-front-end-development-certification/basic-javascript.json
+++ b/challenges/01-front-end-development-certification/basic-javascript.json
@@ -1969,30 +1969,47 @@
"id": "56533eb9ac21ba0edf2244bf",
"title": "Local Scope and Functions",
"description": [
- "Variables which are declared within a function, as well as function parameters are local. Thos means they are only visible within that function. ",
+ "Variables which are declared within a function, as well as the function parameters have local scope. That means, they are only visible within that function. ",
"Here is a function myTest
with a local variable called loc
.",
- "
function myTest() {", - "
var local1 = \"foo\";
console.log(local1);
}
myTest(); // \"foo\"
console.log(local1); // \"undefined\"
local1
is not defined outside of the function.",
+ "function myTest() {", + "
var loc = \"foo\";
console.log(loc);
}
myTest(); // \"foo\"
console.log(loc); // \"undefined\"
loc
is not defined outside of the function.",
"myVar
inside myFunction
"
],
"releasedOn": "11/27/2015",
"tests": [
- "assert(1===1, 'message: message here');"
+ ""
],
"challengeSeed": [
"function myFunction() {",
" ",
" console.log(myVar);",
"}",
+ "myFunction();",
"",
+ "// 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",
""
],
"tail": [
""
],
"solutions": [
+ "function myFunction() {",
+ " var myVar;",
+ " console.log(myVar);",
+ "}",
+ "myFunction();",
+ "",
+ "// run and check the console ",
+ "// myVar is not defined outside of myFunction",
+ "",
+ "",
+ "// now remove the console.log line to pass the test",
+ "",
""
],
"type": "waypoint",