I have an array like this:
var SOItems = [
{ ID: "10", RevNo: 0 },
{ ID: "11", RevNo: 0 },
{ ID: "10", RevNo: 1 },
{ ID: "10", RevNo: 2 },
{ ID: "12", RevNo: 0 },
{ ID: "12", RevNo: 1 }
];
I have gone through Remove Duplicate and Get Unique and it works but not as expected because it returns the first matching value. I want those unique items whose RevNo
is greater like:
SOItems = [
{ ID: "11", RevNo: 0 },
{ ID: "10", RevNo: 2 },
{ ID: "12", RevNo: 1 }
];
Please suggest me a solution
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…