Advertisement
Guest User

11. Digit as Word

a guest
Jul 23rd, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function convertDigitToWord(value) {
  2.     switch(value) {
  3.         case 1: return 'one';
  4.         case 2: return 'two';
  5.         case 3: return 'three';
  6.         case 4: return 'four';
  7.         case 5: return 'five';
  8.         case 6: return 'six';
  9.         case 7: return 'seven';
  10.         case 8: return 'eight';
  11.         case 9: return 'nine';
  12.     }
  13. }
  14.  
  15.  
  16. console.log(convertDigitToWord(8));
  17. console.log(convertDigitToWord(3));
  18. console.log(convertDigitToWord(5));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement