Use arrayvalues to access (sub)arrays
<p>I have a page where I want to see if a certain value exists in one of the arrays I have defined, there is one main array and several "sub" arrays, they are defined like this:</p>

<pre><code>var main = ['header', 'firstname', 'surname', 'tel'];
var firstname_label = ['Hank', 'Dave', 'Erin', 'Jessica'];
var surname_label = ['Michaels', 'McHankering', 'Jameson', 'Lloydd', 'Eagon', 'Philips'];
var tel_label = ['mobile', 'landline'];
</code></pre>

<p>I want to check the sub arrays with a variable I have, I was thinking something along these lines:</p>

<pre><code>for (i=1;i&lt;=mainCount;i++)
{
    jQuery.inArray(var_x, main[i]_label)
}
</code></pre>

<p>Is something like this possible?</p>
