JSFiddle - React, Tailwind, and code Playground
JavaScript
var a, b, c;
a = [
{
"name": "name",
"location1": "no",
"location2": "no",
"location3": "yes",
"location4": "no",
"location5": "no",
"description": "description of services"},
{
"name": "name2",
"location1": "yes",
"location2": "no",
"location3": "yes",
"location4": "no",
"location5": "no",
"description": "description of services2"},
{
"name": "name3",
"location1": "no",
"location2": "no",
"location3": "no",
"location4": "no",
"location5": "no",
"description": "description of services3"}
];
b = $.grep(a, function(el, i) {
return el.location1.toLowerCase() === "yes"
|| el.location2.toLowerCase() === "yes"
|| el.location3.toLowerCase() === "yes"
|| el.location4.toLowerCase() === "yes"
|| el.location5.toLowerCase() === "yes"
});
c = $.map(b, function(el, i) {
return {
name: el.name,
description: el.description
};
});
$('#r').html(JSON.stringify(c));