I'm looking for a way to read a variable txt from other variables that are basically from a counter of such.
example:
var txt0 = "this is txt 0"
var txt1 = "this is txt 1"
var txt2 = "this is txt 2"
counter = 0 // 1,2 or 3 etc
var a = (var+counter); // this line output : var0;or var3 etc
$(h1').text(a);
console.log(a);
//answer I want is : this is text 0 or 1 or 2;
I tried to create a basic sample to demonstrate my issue, I need to use this format as a lot of the other code is dependent on the dynamic of counters various checks for other content
array?