@extra-array/unique-on.min
TypeScript icon, indicating that this package has built-in type declarations

2.7.8 • Public • Published

Removes duplicate values. 🏃 📼 📦 🌔

Alternatives: compare, map.
This is part of package extra-array.

This is browserified, minified version of @extra-array/unique-on.
It is exported as global variable array_uniqueOn.
CDN: unpkg, jsDelivr.

array.uniqueOn(x, [fn], [ths]);
// x:   an array
// fn:  map function (v, i, x)
// ths: this argument
const array = require('extra-array');

var x = [1, 2, 3, 4, 2, 3];
array.uniqueOn(x);
// [1, 2, 3, 4]

var x = [1, 2, 3, 4, -2, -3];
array.uniqueOn(x, v => Math.abs(v));
// [1, 2, 3, 4]

references

Package Sidebar

Install

npm i @extra-array/unique-on.min

Weekly Downloads

1

Version

2.7.8

License

MIT

Unpacked Size

12.1 kB

Total Files

29

Last publish

Collaborators

  • wolfram77