SHARE
TWEET

Untitled

a guest Jun 20th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // scope & scope chain
  2.  
  3. function a() {
  4.   var myOtherVar = 'inside A'
  5.  
  6.   b()
  7. }
  8.  
  9. function b() {
  10.   var myVar = 'inside B'
  11.  
  12.   console.log('myOtherVar:', myOtherVar)
  13.  
  14.   function c() {
  15.     console.log('myVar:', myVar)
  16.   }
  17.  
  18.   c()
  19. }
  20.  
  21. var myOtherVar = 'global otherVar'
  22. var myVar = 'global myVar'
  23. a()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top