0

I'm getting array of objects as JSON obj from php file. The structure of the object is:

 TCS[] array:
    Array[3]:
       0 Object : 
    { id: "1"
    lay1 :"1.5"
    lay2 : "2"
    lay3 : "0"
    lay4 : "4"
    lay5 : "0"
    lay6 : "7"
    }

To access the elements in Javascript inside loop, I tried to use different approaches but couldn't get a feasible solution.

Eg: TCS[i]."lay"+j     // i, j are variable in for loop . Syntax error.
    TCS[i].eval("lay"+j)  // Gives TCS[i].eval not a function

Please suggest a way to access the elements.

Rajasekhar
  • 894
  • 5
  • 13
  • 25

0 Answers0