topic description
remove objects with the same key value from the object array
sources of topics and their own ideas
related codes
let arr = [
{"weight":10,"id":1},
{"weight":20,"id":2},
{"weight":30,"id":2},
{"weight":40,"id":4},
{"weight":50,"id":5}
];
what result do you expect? What is the error message actually seen?
let arr = [
{"weight":10,"id":1},
{"weight":30,"id":2},
{"weight":40,"id":4},
{"weight":50,"id":5}
];