How to access object from array in if condition
- by Happy
Accesing array objects in javascript
OBJ_ARRAY[j][i] = {
"x1": w * i,
"y1": h * j,
"x2": w * (i + 1),
"cell_color": "blue",
"y2": h * (j + 1),
"name": (i + 1 * (j * 10)) + 1,
"z-index": 10,
"status":isnotactive
}
I have this cell array and all its x1,y1 x2,y2 are generated dynamically.
for eg. if want to compare OBJ_ARRAY[5][5].x110 then alert
if(( OBJ_ARRAY[5][5].x1) > 10)) ;
{
alert("Done");
}
It does not work any idea how it can be fixed?