Skip to content

Instantly share code, notes, and snippets.

const removeDuplicates = (str) => {
const existingIds = new Set();
const jsonObj = JSON.parse(str);
const result = [];
for (const obj of jsonObj) {
if (!existingIds.has(obj.id)) {