v2.0.0
Simplified algorithm to compare two variables of any type. This repository can be cloned and the code converted to vanilla JavaScript.
- Clone this repository or copy the "recursiveComparator.ts" file content
- Optional: convert the code to JavaScript using a transpilation tool like Babel
- Use it in your application by importing "compare" from "path/to/file"
compare(variable1, variable2, filterFunction)
Example:
compare<number>(1, 2, (a, b) => a === b); //False
compare<number>(1, 2, (a, b) => a !== b); //True