Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getPlatform() {
- var platformName = 'JavaScript';
- function displayPlatformName() {
- alert(platformName);
- }
- return displayPlatformName;
- }
- var currentPlatformName = getPlatform();
- // This has access to the local variable 'platformName' of exited function getPlatform
- // present in the lexical environment when the 'displayPlatformName'is created
- currentPlatformName();
Add Comment
Please, Sign In to add comment