1

In my angular project I often need to compare JSONs in my Karma/Jasmine tests and it would be really instrumental to have a console output of what was added and removed in comparison between 2 structures (e.g. these fields added, these changed values and these disappeared)

The format of such output is not important as soon as I can figure our the difference. Perhaps one or few JSONs.

Is there a good way to produce such a difference info?

onkami
  • 8,791
  • 17
  • 90
  • 176
  • Possible duplicate [here](http://stackoverflow.com/questions/201183/how-to-determine-equality-for-two-javascript-objects). – bcr Nov 20 '15 at 13:39

1 Answers1

1

You can take any JS diff library for that. For example: https://github.com/kpdecker/jsdiff

Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156