Get started with jsdiff CDN
Stable version
Copied!
How to start using jsdiff CDN
const JsDiff = require('diff'); // Assuming you're using a bundler like webpack or parcel
// If you're not using a bundler, replace the above line with the following script tag:
// <script src="https://cdn.jsdelivr.net/npm/diff@5.2.0/dist/diff.min.js"></script>
const oldText = 'Hello, world!';
const newText = 'Hello, everyone!';
const diff = new JsDiff().diffWords(oldText, newText);
const output = JsDiff.asText(diff);
console.log(output);
Copied!
Copied!