is It possible to find the undefined state of an array using Jquery method "inArray" -


i finding array exist or not, if that's not exist became undefined using if condition, possible find same using jquery's inbuild method "inarray"..

my try:

it works fine:

var group = [];  if(group[i % 3] === undefined){         group[i % 3] = $("<fieldset />");     } 

but using jquery method not proper result:

if($.inarray(group[i % 3], []) < 0){         group[i % 3] = $("<fieldset />");     } 

any 1 give me correct suggestion use jquery method find array "undefined"?

if($.inarray(group[i % 3], group ) === undefined ){         group[i % 3] = $("<fieldset />");     } 

Comments