Looking up arrays
<p>I have an array in JS and need to look up the data by doing checks against it, but am wondering how i do it =/</p>

<p>My array is structured like this :</p>

<pre><code>//global array spritea
var listObj = {
    id: uid,
    data: [
        abposx,
        abposy,
        (abposx+imgwidth),
        (abposy-imgheight)
    ]
};                  

spritea.push(listObj);
</code></pre>

<p>This is in a loop so an example of the array is :</p>

<pre><code>spritea = [
    {
        id: "135", 
        data: [9,129,345, 687]
    },
    {
        id: "239", 
        data: [596,382,0,687,33467]
    }
];
</code></pre>

<p>So what im trying to do is this:</p>

<p>Find </p>

<pre><code>id where x is &gt; data[0] &amp;&amp; y &gt; data[1] &amp;&amp; x &lt; data[2] &amp;&amp; y &lt; data[3]
</code></pre>

<p>And then it returns the id ?</p>

<p>Any one know how to do that? Its really confusing me =/</p>
