JSFiddle - React, Tailwind, and code Playground

by benjamine

HTML

<script src="http://benjamine.github.io/jsondiffpatch/build/jsondiffpatch.min.js"></script>
<script src="http://benjamine.github.io/jsondiffpatch/build/jsondiffpatch-formatters.min.js"></script>
<link rel="stylesheet" href="http://benjamine.github.io/jsondiffpatch/formatters-styles/html.css">
<div id="delta">
</div>

JavaScript

Array.prototype.TestExtension = function () { };

var obj1 =  { a: 1, b: 2, c: 3, d: 4 };

var obj2 = { b:2, c:3, d:4, e:5 };

var delta = jsondiffpatch.diff(obj1, obj2);
document.getElementById('delta').innerHTML = jsondiffpatch.formatters.html.format(delta, obj1);

jsondiffpatch.formatters.html.showUnchanged(true, null, 800);