There is a similar question on StackOverflow here in this question we need to get the difference in the array.
But I just want true or false. I don't need the different array.
I tried it like this:
groups = [{id: 1, name: "check 1"}, {id: 2, name: "check 2"}]
checkedgroups = [{id: 1, name: "check 1"}, {id: 2, name: "check 2"}, {id: 3, name: "check 3"}]
My solution:
_.differenceBy(groups, checkedGroups, 'id').length
differenceByfunction?differenceByfunction. I suspect the error is caused by something in there.checkedgroups.length - groups.lengthtrueorfalseas your output, but then at the bottom of your question, you say you expect a number representing the length as the output? Which one is it?