Answers for "remove duplicate elements in array javascript"

PHP
3

javascript dedupe array

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

let x = (names) => names.filter((v,i) => names.indexOf(v) === i)
x(names); // 'John', 'Paul', 'George', 'Ringo'
Posted by: Guest on February-14-2020

Code answers related to "remove duplicate elements in array javascript"

Browse Popular Code Answers by Language