Advertisement
CR7CR7

multiple if

Sep 18th, 2022
606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. let input = [
  2.   'a',
  3. ];
  4.  
  5. let print = this.print || console.log;
  6. let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
  7.  
  8. let letter = gets().toLowerCase();
  9.  
  10. if (letter === 'a') {
  11.   console.log('Vowel [ei]');
  12. } else if (letter === 'e') {
  13.   console.log('Vowel [i:]');
  14. } else if (letter === 'i') {
  15.   console.log('Vowel [ai]');
  16. } else if (letter === 'o') {
  17.   console.log('Vowel [ou]');
  18. } else if (letter === 'u') {
  19.   console.log('Vowel [ju:]');
  20. } else {
  21.   console.log('Consonant');
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement