Skip to content

isEqual

Subhajit Sahu edited this page Jun 17, 2020 · 11 revisions

Checks if two maps are equal. [:running:] 📼 [:package:] [:moon:] [:ledger:]

Similar: [compare], [isEqual].

map.isEqual(x, y, [fc], [fm]);
// x:  a map
// y:  another map
// fc: compare function (a, b)
// fm: map function (v, k, x)
const entries = require('extra-entries');

var x = [['a', 1], ['b', 2]];
var y = [['a', 1], ['b', 2]];
entries.isEqual(x, y);
// true

var y = [['a', 11], ['b', 12]];
entries.isEqual(x, y);
// false

entries.isEqual(x, y, (a, b) => (a % 10) - (b % 10));
// true

entries.isEqual(x, y, null, v => v % 10);
// true

references

Clone this wiki locally