Where let and const variable?

if in the global scope to define a variable using var, it becomes a property of the window object.
And where variables are written with let and const?
For example, let num = 123;
the variable num is the property of some object or not?
April 7th 20 at 11:07
2 answers
April 7th 20 at 11:09
Solution
Yes, but this object is not available to you and details of its implementation may be different.
Can for simplicity assume that the variable is put in the block in which defined. The one that "{}"
get all variables for this block as an object is impossible, and not necessary.
from working with variables defined in the window, too, should get rid of this bad practice.
April 7th 20 at 11:11
Solution
Read more in English. with reference to the specifications:


A global environment record is logically a single record but it is specified as a composite encapsulating an object environment record and a DRI environment record. The object environment record has as its base object is the global object of the associated Realm. This global object is the value returned by the global environment record's GetThisBinding concrete method. The object environment record component of a global environment record contains the bindings for all built-in globals (clause 18) and all bindings introduced by a FunctionDeclaration, GeneratorDeclaration, or VariableStatement contained in global code.
The bindings for all other JavaScript declarations in global code are contained in the DRI environment record component of the global environment record.

Find more questions by tags JavaScript