Last active
October 7, 2016 09:21
-
-
Save veelenga/bfcb9575b798273ec5d5b9b270d0ec3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# equal jsons | |
json1 = '{"polygons":[{"type":"rectangle","vertices":[{"x":1621.5,"y":1079.5},{"x":2674,"y":1079.5},{"x":2674,"y":2528},{"x":1621.5,"y":2528}],"category":"name"}]}' | |
json2 = '{"polygons":[{"type":"rectangle","category":"name","vertices":[{"x":1621.5,"y":1079.5},{"x":2674,"y":1079.5},{"x":2674,"y":2528},{"x":1621.5,"y":2528}]}]}' | |
rez1 = JSON.parse(json1) | |
rez2 = JSON.parse(json2) | |
rez1 == rez2 # true | |
# not equal jsons | |
json1 = '{"polygons":[{"type":"rectangle","vertices":[{"x":1621.5,"y":1079.5},{"x":2674,"y":1079.5},{"x":2674,"y":2528},{"x":1621.5,"y":2528}],"category":"name"}]}' | |
json2 = '{"polygons":[{"type":"rectangle","category":"name","vertices":[{"x":2621.5,"y":1079.5},{"x":2674,"y":1079.5},{"x":2674,"y":2528},{"x":1621.5,"y":2528}]}]}' | |
rez1 = JSON.parse(json1) | |
rez2 = JSON.parse(json2) | |
rez1 == rez2 # false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment