Created
October 24, 2018 17:40
-
-
Save lovubuntu/b5294b0c6ef182cf84dcf7f72a0e1b53 to your computer and use it in GitHub Desktop.
First try with lodash
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
let _ = require('lodash'); | |
const unionList = _.unionWith(oldSelectedList, newlySelectedList, (o, n) => o.id === n.id); | |
const finalList = _.intersectionWith(unionList, newlySelectedList, (u, n) => u.id === n.id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment