I have two arrays:
var array_old = [{id:"5436", title:"I Like you boy"}, {id:"5437", title:"Hello how are you"}];
var array_new = [{id:"5436", title:"I Like you boy"}, {id:"1132", title:"I'm fine"}];
$.each(array_old, function(id, array)
{
if(!$.inArray(array['id'], array_new, 1)>-1){
alert(array['id'] + " does not exist in array_new");
}
});
I want to check if the IDs of array_old exist in array_new, so I'm expecting the code to output "5437 does not exist in array_new" in this example.
I can't find any function that would allow me to do that, so how should I do it?