Guest User

Untitled

a guest
Jan 17th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. function getPlatform() {
  2. var platformName = 'JavaScript';
  3. function displayPlatformName() {
  4. alert(platformName);
  5. }
  6. return displayPlatformName;
  7. }
  8.  
  9. var currentPlatformName = getPlatform();
  10.  
  11. // This has access to the local variable 'platformName' of exited function getPlatform
  12. // present in the lexical environment when the 'displayPlatformName'is created
  13. currentPlatformName();
Add Comment
Please, Sign In to add comment