JSFiddle - React, Tailwind, and code Playground
by rmurphey
JavaScript
function watWord(num) {
if (!num) { return false; }
var words = {
1 : 'one',
2 : 'two',
3 : 'three',
4 : 'four',
5 : 'five',
6 : 'six',
7 : 'seven',
8 : 'eight',
9 : 'nine',
10 : 'ten'
};
return words[num] || false;
}
console.log(watWord(9));