Answers for "no duplicate in an array"

4

how to remove duplicates in array in javascript

const numbers = [1 , 21, 21, 34 ,12 ,34 ,12];
const removeRepeatNumbers = array => [... new Set(array)]
removeRepeatNumbers(numbers) // [ 1, 21, 34, 12 ]
Posted by: Guest on September-25-2020

Code answers related to "no duplicate in an array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language