Answers for "remove duplicates with reference javascript array"

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 duplicates with reference javascript array"

Browse Popular Code Answers by Language