Spicy Set 🔥
Creates Set
methods for interacting with objects based on content instead of reference.
Usage
const SpicySet = ; const vanillaSet = ;const spicySet = ; vanillaSet;spicySet; vanillaSet; // output: falsespicySet; // output: true vanillaSet; // Adds object, Set is { {hello: 'world'}, {hello: 'world'} }spicySet; // Doesn't add object, Set is { {hello: 'world'} }
Scripts
- unit tests:
npm test
- html test coverage:
npm run html
- build and view docs:
npm run docs
Help
Why? JavaScript evaluates objects by reference and not value.