1 export function unique(arr) { 2 var res = []; 3 var json = {}; 4 for (var i = 0; i < arr.length; i++) { 5 if (!json[arr[i]]) { 6 res.push(arr[i]); 7 json[arr[i]] = 1; 8 } 9 } 10 return res; 11 }