Variables declared with const and let do not exist in the window object

We all know that variables declared with var in the global scope are stored in the Window object

However, variables declared in the global scope by ES6 const or let are not in the Window object

So where is this global variable abcd stored? After searching, I found them in the function’s internal property [[Scopes]], as shown in the picture below

As shown above, variables declared with const in global scope can be accessed in noop without problem. I used the dir method to print out the properties of the function noop and finally found the missing global variable ABcd in the [[Scopes]] properties.

To the end.