I have a javascript array like this
   var open_chats = [];
   open_chats.push({
    "chatid": 'dfsfsdfsdf',
    "data": 'adfsdf'
   });
I need to check if an item exists in this array, I am using something like this.
    if ($.inArray('dfsfsdfsdf', open_chats) !== -1){
    alert('contains');
    }
Except this does not seem to work. I cant quite find something that will work for this array. Can anyone help?
 
     
    