We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Removes duplicate values. 🏃 📦 🌔
Alternatives: compare, map.
array.unique(x, [fn]); // x: an array // fn: compare function (a, b)
const array = require('extra-array'); var x = [1, 2, 3, 4, 2, 3]; array.unique(x); // [1, 2, 3, 4] var x = [1, 2, 3, 4, -2, -3]; array.unique(x, (a, b) => Math.abs(a) - Math.abs(b)); // [1, 2, 3, 4]
There was an error while loading. Please reload this page.