Skip to content

Instantly share code, notes, and snippets.

@SnowyPainter
Created August 18, 2022 08:30
Show Gist options
  • Save SnowyPainter/7213d3fb4b0a83861e530a47a0748365 to your computer and use it in GitHub Desktop.
Save SnowyPainter/7213d3fb4b0a83861e530a47a0748365 to your computer and use it in GitHub Desktop.
let ids = new Set(arr1.map(d => d.id));
let merged = [...arr1, ...arr2.filter(d => !ids.has(d.id))];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment