value-equal
value-equal
determines if two JavaScript values are equal using Object.prototype.valueOf
.
In many instances when I'm checking for object equality, what I really want to know is if their values are equal. This is good for:
- Stuff you keep in
localStorage
window.history.state
values- Query strings
Installation
Using npm:
$ npm install --save value-equal
Then with a module bundler like webpack, use as you would anything else:
// using ES6 modules; // using CommonJS modulesvar valueEqual = ;
The UMD build is also available on unpkg:
You can find the library on window.valueEqual
.
Usage
; // true; // true; // true; // true; // false; // true; // false; // true; // false
That's it. Enjoy!