var arry = [{
itemType: "1",
item_id: "86753",
organizationId: "3117",
price: "1000",
qty: "1",
},
{
itemType: "1",
item_id: "86753",
organizationId: "3118",
price: "1000",
qty: "1",
},
{
itemType: "1",
item_id: "86753",
organizationId: "3117",
price: "1000",
qty: "1",
}
]
function isRepeat(arr) {
var hash = {};
for (var i in arr) {
if (
hash[arr[i].price] &&
hash[arr[i].itemType] &&
hash[arr[i].item_id] &&
hash[arr[i].qty] &&
hash[arr[i].organizationId]
) {
return true;
} else {
hash[arr[i].price] = true;
hash[arr[i].itemType] = true;
hash[arr[i].item_id] = true;
hash[arr[i].qty] = true;
hash[arr[i].organizationId] = true;
}
}
return false;
};
console.log(isRepeat(arry));