Thanks to visit codestin.com
Credit goes to github.com

Skip to content

compare

Subhajit Sahu edited this page Dec 2, 2022 · 14 revisions

Compare two sets.

Similar: compare, isEqual.


function compare(x, y)
// x: a set
// y: another set
const set = require('extra-set');

var x = new Set([1, 2]);
var y = new Set([1, 2, 3]);
set.compare(x, y);
// → -1

var y = new Set([1, 2]);
set.compare(x, y);
// → 0

var y = new Set([1, -2]);
set.compare(x, y);
// → 1


References

Clone this wiki locally