Skip to content

Instantly share code, notes, and snippets.

@wholypantalones
Last active April 5, 2019 16:59
Show Gist options
  • Save wholypantalones/d0de771a0b2190b5a0efa9e744816a94 to your computer and use it in GitHub Desktop.
Save wholypantalones/d0de771a0b2190b5a0efa9e744816a94 to your computer and use it in GitHub Desktop.
Compare two arrays of objects for differences
b.filter(o => !a.find(o2 => o.id === o2.id))
b.filter(({ value: id1 }) => !a.some(({ value: id2 }) => id2 === id1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment