JSFiddle - React, Tailwind, and code Playground

by jordan_josh3184

JavaScript

var subservices = [{
    "Id": "hello",
    "order": "world"
}, {
    "Id": "abc",
        "order": "xyz"
}, {
    "Id": "hello1",
        "order": "world"
}];

var result = [];

$.each(subservices, function (i, e) {
    var matchingItems = $.grep(result, function (item) {
       return  item.order === e.order;
    });
    if (matchingItems.length === 0) result.push(e);
});

alert(JSON.stringify(result));