Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to remove identical string in javascript

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

let x = (names) => names.filter((v,i) => names.indexOf(v) === i)
x(names); // 'John', 'Paul', 'George', 'Ringo'
 
PREVIOUS NEXT
Tagged: #remove #identical #string #javascript
ADD COMMENT
Topic
Name
4+8 =