Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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'
Source by wsvincent.com #
 
PREVIOUS NEXT
Tagged: #javascript #dedupe #array
ADD COMMENT
Topic
Name
2+2 =