2.2.10 • Published 4 years ago

@extra-lists/compare v2.2.10

Weekly downloads
20
License
MIT
Repository
github
Last release
4 years ago

Compares two lists. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Similar: compare, isEqual.

This is part of package extra-lists.

lists.compare(x, y, [fc], [fm]);
// x:  lists
// y:  another lists
// fc: compare function (a, b)
// fm: map function (v, k, x)
// → x=y: 0, otherwise: -ve/+ve
const lists = require('extra-lists');

var x = [['a', 'b'], [1, 2]];
var y = [['a', 'b', 'c'], [1, 2, 3]];
lists.compare(x, y);
// -1

var y = [['a', 'b'], [1, 2]];
lists.compare(x, y);
// 0

var y = [['a', 'b'], [1, -2]];
lists.compare(x, y);
// 1

lists.compare(x, y, (a, b) => Math.abs(a) - Math.abs(b));
// 0

lists.compare(x, y, null, v => Math.abs(v));
// 0

References

2.2.10

4 years ago

2.2.9

4 years ago

2.2.8

4 years ago

2.2.7

4 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.0

5 years ago

2.1.3

5 years ago

2.1.6

5 years ago

2.1.5

5 years ago

2.1.8

5 years ago

2.1.7

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.91

5 years ago

2.0.90

5 years ago

2.0.89

5 years ago

2.0.88

5 years ago