Search
 
SCRIPT & CODE EXAMPLE
 

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'
Comment

PREVIOUS NEXT
Code Example
Javascript :: disable global require eslint 
Javascript :: fetch api javascript 
Javascript :: how to put text in the center react native 
Javascript :: object length javascript 
Javascript :: how to find and remove object from array in javascript 
Javascript :: reactive forms change event in angular 
Javascript :: vaidate youtube url 
Javascript :: js enums class 
Javascript :: $(this).text() in jquery return white space 
Javascript :: return only specific attributes when making query mongoose 
Javascript :: creating a class in angular 
Javascript :: convert node.js to ES6 
Javascript :: angular add a new line from component 
Javascript :: lodash remove element from list 
Javascript :: javascript string contains 
Javascript :: vuex use state in action 
Javascript :: regex link validation 
Javascript :: momentjs range 
Javascript :: windows how to set process.env variables 
Javascript :: npm ERR! code EJSONPARSE 
Javascript :: onclick inline function react 
Javascript :: react-lottie yarn 
Javascript :: javascript fill array from 0 to n 
Javascript :: get the first word of a string javascript 
Javascript :: object to array javascript 
Javascript :: disable button in swal popup 
Javascript :: read file size javascript 
Javascript :: javascript js isNumber 
Javascript :: basic server on node.js 
Javascript :: how to append value to input field using jquery 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =