Skip to content

Distinct

Malexion edited this page Oct 31, 2016 · 2 revisions

__.distinct(obj, [func])

  • obj Item to iterate over.
  • [func] [Optional] Function to get at the item to be evaluated.

Examples

var d = __.distinct([ 1, 2, 1, 8, 65461, 22, 0, 2 ]);

console.log(d);

d = __.distinct({ a: { value: 2 }, b: { value: 4 }, c: { value: 2 } }, x => x.value);

console.log(d);
Clone this wiki locally