Created
July 5, 2018 12:06
-
-
Save jyotiarora2610/d3982d83715c9667a692ce2be1f94df6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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