Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript string unique characters

const unique = (str) => {
	const cleanStr = str.replace(/ /gi, '');
    const set = [...new Set(cleanStr)];

    return set;
}

console.log(unique('asdqwe asdqwet dfadqwre  '));
Comment

how to make a string with unique characters js

const uniq = (str) => {
    console.log(([...new Set(str)]).join(''))
}
uniq('hello')
Comment

PREVIOUS NEXT
Code Example
Javascript :: E: Unable to locate package nodejs 
Javascript :: dockerignore node modules 
Javascript :: copy a file and paste with fs 
Javascript :: javascript start function on load 
Javascript :: datatable scroll horizontal 
Javascript :: install react 
Javascript :: javascript get table row count 
Javascript :: react-native text overflow ellipsis 
Javascript :: Get List of all files in a directory in Node.js 
Javascript :: display none js 
Javascript :: check if a date time string is a valid date in js 
Javascript :: javascript backticks and if statements 
Javascript :: validate Alphabet Letter js 
Javascript :: js copy 2d array 
Javascript :: javascript check if blank space 
Javascript :: jquery prevent event bubbling 
Javascript :: remove last comma from string javascript 
Javascript :: javascript replace spaces with nbsp 
Javascript :: uppercase string in js 
Javascript :: javascript convert between string and ascii 
Javascript :: sanity install 
Javascript :: regex to get items between quotes 
Javascript :: innerwidth react 
Javascript :: english number to bangla javascript 
Javascript :: js this binding setinterval 
Javascript :: create react app netlify 
Javascript :: react index.js 
Javascript :: angular for loop key value 
Javascript :: wrap text react native 
Javascript :: javascript get length of object 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =