1, 2, 8]; const filtered = removeDuplicates(unfiltered); // should be [1, 2, 3, 5, 9, 8] document.getElementById('answer').innerHTML = filtered; function removeDuplicates(arr) { const obj = {}; for (const el of arr) { obj[el] = true; } return Object.keys(obj); }