I have my array like callsData[] which contains objects like following:
{
"caller_id": "110",
"Channel": "SIP/Kam-SBC-0000001c",
"AccountCode": "1004",
"Server": "192.168.1.36",
"Callee": "109",
"connected_line": "109",
"Uniqueid": "145712272845",
"DestChannel": "SIP/Kam-SBC-0000001d",
"DestUniqueid": ["3432423423423","123123123","312321312"]
}
I want to find index of object where my value 3432423423423 is present in the DestUniqueid array.
$.inArray(obj.DestUniqueid, '3432423423423')orobj.DestUniqueid.indexOf('3432423423423');obj.DestUniqueid.indexOf('3432423423423')returns the index of 3432423423423 in the array (0-based) or -1 if it's not found. EDIT:var index = callsData.DestUniqueid.indexOf('3432423423423'); // index is the correct index or -1