This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const removeDuplicates = (str) => { | |
const existingIds = new Set(); | |
const jsonObj = JSON.parse(str); | |
const result = []; | |
for (const obj of jsonObj) { | |
if (!existingIds.has(obj.id)) { |