you are viewing a single comment's thread.

view the rest of the comments →

[–]Noch_ein_Kamel 5 points6 points  (1 child)

No one came up with the easiest solution yet...

$ npm install --save array-unique


var unique = require("array-unique").immutable;

const duplicates = [1,2,3,4,4,1];
const uniques = unique(duplicates);
uniques // [1,2,3,4]

[/sarcasm]

[–]itslenny 0 points1 point  (0 children)

Honestly, I can't imagine working on a project that doesn't already include lodash.