I am trying to loop a array of objects and compare it with another array and check of the key value is present in the array which is to be compared. Here I am not going to check for the array length too.
Example
Array1 is the array which needs to be compared to array 2
[{name:'Linus',id:1},{name:'Anthony',id:2},{name:'Carl',id:3}]
Array 2
[{name:'Linus',id:1},{name:'Anthony',id:2},{name:'Beth',id:3},{name:'Kyle',id:4}]
I am trying to validate if all the id values in array 1 are present in array 2 and if not present then I expect a boolean value and get the best solution in terms of performance.