Function to find the total from an array of object if it contains similar items.
var groupedByItem = arr.reduce(function (result, current) {
var item = current.Item;
if (!result[item]) {
result[item] = {
Type: current.Type,
Item: item,
TotalQuantity: 0
};
}
result[item].TotalQuantity += parseInt(current.Quantity);
return result;
}, {});
var resultArray = Object.values(groupedByItem);