Answers for "how to remove duplicate value in array in js"

95

js delete duplicates from array

const names = ['John', 'Paul', 'George', 'Ringo', 'John'];

let unique = [...new Set(names)];
console.log(unique); // 'John', 'Paul', 'George', 'Ringo'
Posted by: Guest on March-11-2020
0

remove duplicates javascript

function withoutDuplicates (arr) {
  return [...new Set(arr)];
}
Posted by: Guest on January-27-2022

Code answers related to "how to remove duplicate value in array in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language