I have the following JSON array:
[
{ "id": "1", "service": "B" },
{ "id": "2", "service": "A" },
{ "id": "3", "service": "C" }
]
I want to check if the JSON array has service "A", if yes then return true.
I am using angular.js. I used angualr.forEach loop for it but break is not working in angular forEach. Is there any solution with JavaScript map function.
So, I want to create a function which has the above JSON array as an argument and returns true if the JSON array has a particular value("A") for a particular Key("service").