How to read a variable whose name is a sequence?

has a series of variables named var0,var1,var2...var99
. How do I write a loop to display all variable values in devtool?

Thank you.

< hr >

maybe my question is not accurate. I use for loop to output the value of variable

.
 console.log("var"+ i) console.log(`var${i}`)

output in devtool is the character var0,var1...var99
rather than the value of the variable

how should I write

in this place?
Jun.28,2022

for(i = 0; i < 100; iPP) {
    console.log(window['var' + i]);
}

-sharp

let or close for


new Function('return var' + i)()

var var0 = 1
this["var0"]
Menu