Instantly share code, notes, and snippets.

Embed
What would you like to do?
function movieStar() { // function declaration is moved to the top of the global scope
  var name; // variable declaration is moved to the top of the local scope 
  name = “Meryl Streep”; // variable assignement is left in place
  console.log(name);
}
movieStar(); // Prints “Meryl Streep”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment