duplicate encoder
const duplicateEncode = word => {
let newString = ''
word = word.toLowerCase() || word
word.split('').filter((x, index) => {
if(word.indexOf(x) !== index){
newString += ')'
}else if(word.lastIndexOf(x) !== index){
newString += ')'
}else{
newString += '('
}
})
return newString
}
console.log(duplicateEncode("O!!!!@k!!!H!!!)!!n!"))
Also in JavaScript:
- javascript remove index from array
- transaction commit rollback nodejs
- setProps jest
- discord.js custom create channel
- reverse string js
- angular trigger input change
- react context api
- update angular cli
- if cookie exists javascript
- subject in angular 8
- javascript load image programmatically
- how to connect react to backend
- traccar attributes list
- javascript compare and sort strings alphabetically
- node path resolve
- javascript compose function
- how to see my timezone using js
- regular expression to remove empty lines after text
- how to use jq with json data
- object to json c#
- combine values of address line 1 and address line 2 javascript
- image popup js close button
- jquery add text to textbox
- how can when click buton scrool to another elemtn