Merge pull request #7856 from erictleung/fix/usability-on-local-scope-and-functions

Clarify instructions for Local Scope and Functions
This commit is contained in:
Rex Schrader
2016-04-03 14:11:29 -07:00

View File

@ -2262,7 +2262,8 @@
"<blockquote>function myTest() {<br> var loc = \"foo\";<br> console.log(loc);<br>}<br>myTest(); // \"foo\"<br>console.log(loc); // \"undefined\"</blockquote>", "<blockquote>function myTest() {<br> var loc = \"foo\";<br> console.log(loc);<br>}<br>myTest(); // \"foo\"<br>console.log(loc); // \"undefined\"</blockquote>",
"<code>loc</code> is not defined outside of the function.", "<code>loc</code> is not defined outside of the function.",
"<h4>Instructions</h4>", "<h4>Instructions</h4>",
"Declare a local variable <code>myVar</code> inside <code>myFunction</code>" "Declare a local variable <code>myVar</code> inside <code>myFunction</code>. Run the tests and then follow the instructions commented out in the editor.",
"<strong>Hint</strong><br>Refreshing the page may help if you get stuck."
], ],
"releasedOn": "January 1, 2016", "releasedOn": "January 1, 2016",
"head": [ "head": [
@ -2295,11 +2296,11 @@
"}", "}",
"myFunction();", "myFunction();",
"", "",
"// run and check the console ", "// Run and check the console",
"// myVar is not defined outside of myFunction", "// myVar is not defined outside of myFunction",
"console.log(myVar);", "console.log(myVar);",
"", "",
"// now remove the console log line to pass the test", "// Now remove the console log line to pass the test",
"" ""
], ],
"tail": [ "tail": [