Skip to content

Instantly share code, notes, and snippets.

@jomurgel
Created March 25, 2018 18:24
Show Gist options
  • Save jomurgel/4c8f9f5c0d80e7137b2805199acb54c7 to your computer and use it in GitHub Desktop.
Save jomurgel/4c8f9f5c0d80e7137b2805199acb54c7 to your computer and use it in GitHub Desktop.
Remove Differences from 2 Arrays
// Remove all but similariy.
array1.filter( item => array2.every( item2 => item2.id !== item.id ) );
// REmove similarity.
array1.filter( item => array2.every( item2 => item2.id === item.id ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment