9951 explained code solutions for 126 technologies


javascriptGet unique values from array


var list = [1, 2, 3, 4, 5, 5];
var unique = [...new Set(list)];ctrl + c
var list

declare test array to get unique values from

new Set(list)

store unique values from passed list array (docs)

var unique

will contain final list with unique values only