Created
May 16, 2017 14:37
-
-
Save Le-Fu/5a027be245c98ac7fd5e66c79d7a44b6 to your computer and use it in GitHub Desktop.
// source http://jsbin.com
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> | |
| function firstNonRepeatingLetter(s) { | |
| for(var i in s) { | |
| if(s.match(new RegExp(s[i],"gi")).length === 1) { | |
| return s[i]; | |
| } | |
| } | |
| return ''; | |
| } | |
| var ans = firstNonRepeatingLetter('sdfak\skdf&%$skdjf.,'); | |
| document.write(ans); | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">function firstNonRepeatingLetter(s) { | |
| for(var i in s) { | |
| if(s.match(new RegExp(s[i],"gi")).length === 1) { | |
| return s[i]; | |
| } | |
| } | |
| return ''; | |
| } | |
| var ans = firstNonRepeatingLetter('sdfak\skdf&%$skdjf.,'); | |
| document.write(ans);</script></body> | |
| </html> |
This file contains hidden or 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
| function firstNonRepeatingLetter(s) { | |
| for(var i in s) { | |
| if(s.match(new RegExp(s[i],"gi")).length === 1) { | |
| return s[i]; | |
| } | |
| } | |
| return ''; | |
| } | |
| var ans = firstNonRepeatingLetter('sdfak\skdf&%$skdjf.,'); | |
| document.write(ans); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment