In my CouchDB reduce function I need to reduce a list of items to the unique ones.
Note: In that case it\'s ok to have a list, it will be a small number of items
The best method seem to be using ES6 and Set. Single line and faster* than above according to fiddle
const myList = [1,4,5,1,2,4,5,6,7]; const unique = [...new Set(myList)]; console.log(unique);
*tested in safari