Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jyotiarora2610/d3982d83715c9667a692ce2be1f94df6 to your computer and use it in GitHub Desktop.
Save jyotiarora2610/d3982d83715c9667a692ce2be1f94df6 to your computer and use it in GitHub Desktop.
var str = 'the quick brown fox jumps then quickly blow air'
var arr = []
for(let i=0; i<=str.length; i++) {
if (arr[str[i]]) {
arr[str[i]]++
} else {
arr[str[i]] = 1
}
}
console.log(arr)
for(let i=0; i<= str.length -1; i++) {
if(arr[str[i]] == 1) {
console.log(str[i])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment