diff is not a function
connor11528 opened this issue · comments
I've loaded in the library via a script tag as specified in the readme. I am trying to compare to JSON objects using the diff function. When the user clicks a button I run the compare function:
var diff = new DeepDiff();
var differences = diff.diff(leftObject, rightObject);
This code gives me an error TypeError: diff.diff is not a function
. I load in the library with the script tag below:
<script src="https://cdn.jsdelivr.net/npm/deep-diff@1/dist/deep-diff.min.js"></script>
How can I run the diff compare function and why am I getting diff is not a function error?
Solution:
var differences = DeepDiff.diff(leftObject, rightObject);