function dedupe(arr) { return Array.from(new Set(arr));}
var arr = [2,2,3,4,5,4];console.log(dedupe(arr)); // [2, 3, 4, 5]