function myLocalScope() {
var myVar = "Lawrence";
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
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36.
It has worked for me, but please be a helper to me. I really want to learn coding at freecodecamp, but I am not still understanding what I am doing.
I will be glad if you can please give me your contacts.
Here are mine:
Tels: +231 778314079/880956709
Emails: lawrencephillips102@gmail.com/nyannueflomo20@gmail.com
Facebook: Lawrence Phillips/ nyannue Flomo
This piece seems to be touching on the topic of Scope (more info).
Scope comes in many flavors. To define your scope you could ask, what can your code access? What variables can it reach and use?
Everything your code can touch, is yourscope. It can be a confusing topic at first. Also , note that detailed and focused questions are a good way for allowing others to best address the parts you are having trouble with.
A Google search for JavaScript Scope would give a lot of examples and reads. I’ll list a few I like at the bottom.