Skip to content

Instantly share code, notes, and snippets.

@Damimd10
Created March 24, 2019 02:49
Show Gist options
  • Save Damimd10/ba7efd95491a191bc99b5d676f1ca561 to your computer and use it in GitHub Desktop.
Save Damimd10/ba7efd95491a191bc99b5d676f1ca561 to your computer and use it in GitHub Desktop.
// global scope
var name = 'Damian';
function getName(name) { // passing (name) makes it local scope
console.log(a); // log the given argument, not the global value of '1'
}
// local scope again
function localScope() {
var isGlobalScope = false;
console.log(isGlobalScope); // log false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment