Jquery inArray function always returns -1

Jquery inArray function always returns -1

In Firebug when I rollover the SelectList variable it certainly looks like an array.

if (GroupList != "") {
    $
('select[name^=DDLColumns1] option').each(function(){
       
if ($(this).val() != "-1") {
           
var ItemsArray = $(this).val().split('|');
           
var DataTypes = ItemsArray[1];
           
var TestItem = "[" + ItemsArray[0] + "]";

PROBLEM IS HERE

---> if (jQuery.inArray(TestItem, SelectList) != -1) {
                   
if(DataTypes == 104)
                       
NewSelectList += " SUM(CAST(" + ItemsArray[0] + " AS INT)) as " + ItemsArray[0] + ",";
               
else
                   
NewSelectList += " max(" + ItemsArray[0] + ") as " + ItemsArray[0] + ",";
           
}

       

}
   
});
if(NewSelectList.length > 0) {
       
NewSelectList = NewSelectList.substring(0, NewSelectList.length - 1);
       
SelectList = NewSelectList;
   
}


}//end of if GroupList is not empty




SelectList contains "[DateDue],[TypeFileID],... etc.. so I need to
format the TestItem variable to match the values in the SelectList.


ItemsArray contains the name of the selected column, this is a
dynamically populated array from a sql statement that is passed through
ajax ItemsArray contains two values: "ColumnName|ColumnDataType"

 My only conclusion is that somehow even though the SelectList is
populated and looks like an array Jquery doesn't evaluate it as an array
for the purpose of the inArray function?? Is there a way I can make
sure the type is array prior to attempting the inArray function?