JSFiddle - React, Tailwind, and code Playground
by dirtyd77
HTML
<script src="https://cdn.jsdelivr.net/lodash/4.11.2/lodash.min.js"></script>
JavaScript
var arr1 = [ { id: 1, val: 'val 1', other: '' }, { id: 2, val: 'val 2', other: '' } ];
var arr2 = [ { id: 1, val: 'val 1- updated' } ];
var intersection = _.intersectionBy(arr1, arr2, 'id');
console.log(intersection);