Created
March 25, 2018 18:24
-
-
Save jomurgel/4c8f9f5c0d80e7137b2805199acb54c7 to your computer and use it in GitHub Desktop.
Remove Differences from 2 Arrays
This file contains 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
// 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