Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

JavaScript (and thus JSON) arrays are lists, not sets. You can implement sets using arrays, but this diffs JSON, not your implementation of sets.

It diffs arrays "correctly", though not intelligently. If you have [1,2,3,4,5] and [1,3,4,5] it won't tell you the item at index 1 was removed, it will tell you the items at index 1, 2, 3 were changed and index 4 was removed. Thus it does need a little work, but not in the context you described.

p.s. I'm the author of the JSON Diff tool.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: