Probably best asked in the vRO sub-forum.
Thanks. I moved it to the vRO sub-forum.
When you say compare do you really mean diff as you might in Unix?
Or are you simply interested in checking if the two objects are equal? If the latter then this is will give a simple true/false
if(JSON.stringify(obj1) == JSON.stringify(obj2))
There are a few notes on this too
1. Purists might argue that the test there should be "==="
2. The simple comparison here will only return true if all the internal fields are in the same order (it's comparing text after all)
3. Converting objects to string like this can be expensive if the objects are large
If you want to be able to compare objects regardless of internal field ordering then you might look at Lodash - it's a free JS module built for Websites and Node.js projects but you *should* be able to load it into a vRO context and use it's functionality. Or, copy out the relevant bits to a script/action in vRO and get your comparison done
If you want a full diff and report then you would have to code a specific parser / inspector function I'd imagine. Your XML suggestion might work too but you'd be also writing code for that
Thank you very much for your feedback.
With compare I mean a diff to get all the differences and not only a true or false.
I will check Lodash and I'll get back to you.