SyntaxFix
Write A Post
Hire A Developer
Questions
function removeDuplicates (array) { var sorted = array.slice().sort() var result = [] sorted.forEach((item, index) => { if (sorted[index + 1] !== item) { result.push(item) } }) return result }