Posted 9 March 2021
by Robin La Fontaine

Share this blog:

Read more in Data Management

How to compare JSON values, objects and arrays

Comparing two JSON files is fairly straightforward, though there are a few areas where it is not quite as simple as it seems. The three literal names, truefalse and null are not a problem, though note they must be lower case. Before comparing two numbers, they should be normalised so that 1 and 1.0 would not show a change. Similarly 100 and 1e2 would also be deemed to be equal. For example:

© 2000-2025 DeltaXML Ltd. registered in England and Wales (Company No. 2528681), trading as DeltaXignia. All rights reserved