How can I compare two arrays of objects and update a key if an object exists in both arrays?
$scope.listOne = [
{id: 1, selected: false},
{id: 2, selected: false},
{id: 3, selected: false}
];
$scope.listTwo = [
{id: 4, color: orange},
{id: 5, color: blue},
{id: 2, color: green}
];
Using the above objects, how can I compare them and have listOne[1].selected updated to true?