-3

I have a code like this:

for (var i = 0; i < result.Table.length; i++) {
    for (var x = 0; x < count; x++) {                           
        var xIndex = 'F' + (x + 1)
        var item = result.Table[i].xIndex;
        console.log(item)
    }
}

But unfortunately I can't use xIndex in example as this. So how to change script to be able to set xIndex as identifier?

Thanks.

AstroCB
  • 12,337
  • 20
  • 57
  • 73
user3573096
  • 31
  • 1
  • 1
  • 6

1 Answers1

0

You can't use the dot syntax there, just use brackets and it'll work

result.Table[i][xIndex]
Azeirah
  • 6,176
  • 6
  • 25
  • 44