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