I have a variable with an object. If I declare the variable with var I can call it dynamically with a string from the windows object.
works!
var obj_1 = {
say: "Hello World"
}
str = "obj_" + 1
console.log(window[str])
dont work
const obj_1 = {
say: "Hello World"
}
str = "obj_" + 1
console.log(window[str])