Currently, I am integrating underscorejs into my angular project to eliminate duplicate objects in an array. However, I have encountered an issue where only two string arrays are being kept at a time in biddingGroup. When someone else places a bid that is not already in the array, it ends up overwriting one of the existing array slots instead of adding the new row because it is not considered unique. Any assistance on this matter would be greatly appreciated!
If you require additional information, please do not hesitate to ask.
var newBidder = [{
bidderId: this.userId
}]
biddingGroup.push(newBidder);
console.log("BEFORE USING UNDERSCOREJS");
console.log(biddingGroup);
this.uniqueResult = _.uniq(biddingGroup, "bidderId");
console.log("UNIQUE RESULT");
console.log(this.uniqueResult);