Skip to content

Instantly share code, notes, and snippets.

Created June 9, 2017 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/14ccc4cb5e7a33680f40e95ddd653df1 to your computer and use it in GitHub Desktop.
Save anonymous/14ccc4cb5e7a33680f40e95ddd653df1 to your computer and use it in GitHub Desktop.
function myLocalScope() {
'use strict';
var myVar = "cool";
console.log(myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log(myVar);
// Now remove the console log line to pass the test
It says that I have no global myVar variable, but I need to add a local myVar variable. Can anyone help?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment