@extra-array/is-unique-on
v2.7.8
Published
Checks if there are no duplicate values.
Downloads
194
Maintainers
Readme
Checks if there are no duplicate values. :running: :vhs: :package: :moon:
Alternatives: compare, map. This is part of package extra-array.
array.isUniqueOn(x, [fn], [ths]);
// x: an array
// fn: map function (v, i, x)
// ths: this argument
const array = require('extra-array');
var x = [1, 2, -1, -2];
array.isUniqueOn(x);
// true
array.isUniqueOn(x, v => Math.abs(v));
// false