I have an array of objects and need to find whether an array of objects contain a given value for any property? (It can be for any property).
E.g.:
[
{product_name: "iphone 7s " , cost: "122" , type: "product" },
{name: "John Snow " , email: "[email protected]" , type: "contact"},
{seller_name: "John Smith " , brand: "Xbrand" , type: "seller"}
];
I need a function to return the last two objects in which value "John" exists.