Menu
Coddy logo textTech

6. Remove Duplicates

Lesson 7 of 31 in Coddy's 30 Days of Logic Building in Javascript course.

Remove Duplicates from an Array

challenge icon

Challenge

Easy

Write a function that removes duplicate elements from an array.

  • Input: <strong>[1, 2, 2, 3, 4, 4, 5]</strong>
  • Output: <strong>[1, 2, 3, 4, 5]</strong>

Try it yourself

function removeDuplicates(arr) {
    // write your code below
    
}

All lessons in 30 Days of Logic Building in Javascript