Last active
July 12, 2018 21:07
-
-
Save brianfiszman/65fef644770b4a3eabb4a1effeb185f6 to your computer and use it in GitHub Desktop.
Obtain a letter if 's' match a regexp
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
const getLetter = s => | |
s.match(/^[aeiou]/) | |
? "A" | |
: s.match(/^[bcdfg]/) | |
? "B" | |
: s.match(/^[hjklm]/) | |
? "C" | |
: "D"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment