Last active
August 29, 2015 14:00
-
-
Save kenany/806dfac4db64196f218b to your computer and use it in GitHub Desktop.
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
| var MAP = { | |
| 'a': 'ᵃ', | |
| 'b': 'ᵇ', | |
| 'c': 'ᶜ', | |
| 'd': 'ᵈ', | |
| 'e': 'ᵉ', | |
| 'f': 'ᶠ', | |
| 'g': 'ᵍ', | |
| 'h': 'ʰ', | |
| 'i': 'ᶦ', | |
| 'k': 'ᵏ', | |
| 'l': 'ᶫ', | |
| 'm': 'ᵐ', | |
| 'n': 'ᶰ', | |
| 'o': 'ᵒ', | |
| 'p': 'ᵖ', | |
| 'r': 'ʳ', | |
| 's': 'ˢ', | |
| 't': 'ᵗ', | |
| 'u': 'ᵘ', | |
| 'w': 'ʷ', | |
| 'y': 'ʸ' | |
| }; | |
| var str = 'kenan'; | |
| str = str.replace(/[\w]/g, function(c) { | |
| return MAP[c]; | |
| }); | |
| // => 'ᵏᵉᶰᵃᶰ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment