Skip to content

Instantly share code, notes, and snippets.

@codeperfectplus
Last active September 4, 2023 06:08
Show Gist options
  • Select an option

  • Save codeperfectplus/3193e8d21fd404c94225955ce27a4d9b to your computer and use it in GitHub Desktop.

Select an option

Save codeperfectplus/3193e8d21fd404c94225955ce27a4d9b to your computer and use it in GitHub Desktop.
function getLetter(s) {
let letter;
// Write your code here
switch (true) {
case 'aeiou'.includes(s[0]):
letter = 'A';
break;
case 'bcdfg'.includes(s[0]):
letter = 'B';
break;
case 'hjklm'.includes(s[0]):
letter = 'C';
break;
case 'npqrstvwxyz'.includes(s[0]):
letter = 'D';
break;
}
return letter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment