2019-06-30

JavaScript - jQuery Filter

// Array of json objects
let json_array = [
{
"item_name": "United States"
, "item_property": "123"
},
{
"item_name": "United Arab Emirates"
, "item_property": "123"
},
{
"item_name": "Mexico"
, "item_property": "234"
}
];

// Filter
$(json_array).filter(function (index, value){
        return value.item_property === '123';
    });

No comments:

Post a Comment