UNPKG

@webqit/util

Version:

Utility functions used accross multiple JS libraries.

15 lines (13 loc) 247 B
/** * Returns a list of unique items. * * @param array arr * * * @return array */ export default function(arr) { const distinct = (value, index, self) => { return self.indexOf(value) === index; }; return arr.filter(distinct); };