When i do this in JS:
const myConst = "something";
outside any function, how can I access myConst
by its name ?
From what I have understood so far is, that myConst ends up in the "Declarative Environment Record", but i don't know how to access it other than directly, like writing
console.log(myConst);
Thx
window["myConst"] //would only work if myConst would have been defined using var