Есть JSON массив:
var json = [{
"variation_id": 618,
"attributes": {
"attribute_pa_color": "navy",
"attribute_pa_size": "l"
},
"sku": "618"
}, {
"variation_id": 619,
"attributes": {
"attribute_pa_color": "gray",
"attribute_pa_size": "l"
},
"sku": "619"
},
{
"variation_id": 620,
"attributes": {
"attribute_pa_color": "navy",
"attribute_pa_size": "s"
},
"sku": "620"
}, {
"variation_id": 621,
"attributes": {
"attribute_pa_color": "gray",
"attribute_pa_size": "s"
},
"sku": "621"
}];
нужно отфильтровать данные по цвету navy ("attribute_pa_color": "navy")
чтобы вывело массив в таком виде:
{
"variation_id": 618,
"attributes": {
"attribute_pa_color": "navy",
"attribute_pa_size": "l"
},
"sku": "618"
},{
"variation_id": 620,
"attributes": {
"attribute_pa_color": "navy",
"attribute_pa_size": "s"
},
"sku": "620"
}