WordToDigit JavaScript Solution