I currently have 1 object retrieved from local storage, but it seems to contain some duplicates. What is the easiest way to remove these duplicates?
The array object I am working with is called "mainchart".
function check() {
for (let i = 0; i < mainchart.length; i++) {
for (let j = i + 1; j < mainchart.length; j++) {
if (mainchart[i].id === mainchart[j].id) {
console.log(mainchart[i], mainchart[j]);
}
}
}
}
check();