Skip to content

Commit

Permalink
Merge pull request #1 from tiy-orl/master
Browse files Browse the repository at this point in the history
Monday Quiz
  • Loading branch information
JCR08 authored Apr 10, 2017
2 parents 2c6e6f1 + bc36b6d commit 6fcfd1a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions englishify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
let numbers = {
0: 'zero',
1: 'one',
2: 'two',
3: 'three',
4: 'four',
5: 'five',
6: 'six',
7: 'seven',
8: 'eight',
9: 'nine',
10: 'ten',
11: 'eleven',
12: 'twelve',
13: 'thirteen',
14: 'fourteen',
15: 'fifteen',
16: 'sixteen',
17: 'seventeen',
18: 'eighteen',
19: 'nineteen',
20: 'twenty'
}

function englishify(num) {
if (num >= 0 && num <= 20) {
return numbers[num];
}
return 'Please enter a number between 0 and 20 inclusive.';
}

console.log( englishify(1) );

0 comments on commit 6fcfd1a

Please sign in to comment.