I have the following issue:
const value1 = "some value";
var value2 = "some value";
console.log(window["value1"]); // undefined
console.log(window["value2"]); // some value
I know that const is block scoped and that is the reason I cannot access it through the window object. My question is, is there any way to access a const variable using only a string identifier.
If all I have access to is "value1", how do I get a handle on the actual value1? Is it even possible?