Duplicate #123447
Answered
by
Sackitey68
BarryYuniwo
asked this question in
Programming Help
Duplicate
#123447
-
Select Topic AreaQuestion BodyHow do i remove duplicate from an array |
Beta Was this translation helpful? Give feedback.
Answered by
Sackitey68
May 11, 2024
Replies: 1 comment 1 reply
-
// Given this is the array const arr = [1, 2, 3, 1, 2, 5, 1] // this will removed the duplicate |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
BarryYuniwo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// Given this is the array
const arr = [1, 2, 3, 1, 2, 5, 1]
const duplicateRemoved = [...new set(arr)]
console.log(duplicateRemoved)
// this will removed the duplicate