How to access object from array in if condition

Posted by Happy on Stack Overflow See other posts from Stack Overflow or by Happy
Published on 2014-06-04T09:08:53Z Indexed on 2014/06/04 9:24 UTC
Read the original article Hit count: 144

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].x1>10 then alert

 if(( OBJ_ARRAY[5][5].x1) > 10)) ;
                                   {                                   
                                    alert("Done");
                                   }

It does not work any idea how it can be fixed?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery