SHARE
TWEET

Untitled

a guest Mar 26th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var a = 10; // global scope
  2. function foo() { // enter new scope, TDZ starts
  3.  
  4. // Uninitialised binding for 'a' is created
  5.     console.log(a); // ReferenceError
  6.  
  7. // TDZ ends, 'a' is intialised with value of 20 here only
  8.     let a = 20;
  9. }
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
 
Top