0

I have two arrays of objects. The objects have the same structure, just the values can be different. How can I compare their values? I can use a loop, but is there any better option?

One object looks like: {id:1, name:"object"};

anyway07
  • 227
  • 1
  • 4
  • 12
  • tl;dr If you're not worried about comparing functions, you can simply do `JSON.stringify(objectA) === JSON.stringify(objectB)`. – code Mar 11 '22 at 06:56
  • By the way, I don't know about Angular, but AngularJS has a special utility function: https://stackoverflow.com/a/19055489/15359157 – code Mar 11 '22 at 06:57

0 Answers0