I have two arrays, how do I find matchings elements and perform some action? (lodash)
问题 var array1 = [{Age: 24, Name: "Test", StudentID: 101, Checked: false}, {Age:25, Name: "Test", StudentID: 102, Checked: false}]; var array2 = [{ID: 101}]; If any element in array1 has a property of StudentID that is equal to an ID property present in array2 I'd like to set the Checked property in array1 to true. Any tips? I'd like to do this without writing nested _.each statements. This is my first take; however, I believe _.some performs an interation anyway. _.each($scope.array1, function