var myArr = [1, 2, 2, 2, 3]; var mySet = new Set(myArr); myArr = [...mySet]; console.log(myArr); // 1, 2, 3