How can we build a program in which if we will put number so it will give it's spelling in JavaScript
2 Answers
New AnswerLike if user will give number 20 so in alert it will say twenty
2/26/2019 4:11:55 AM
Zainab Idrees2 Answers
New AnswerFirst, you’ll need to hard-code all the spellings: One - Nine, Ten - Ninety (by tens), Hundred, Thousand, Million.. etc. You can put these spellings in a dictionary and/or make case statements based on the length of the whole number and then iterate through each sub-number. Try an attempt, and then we can try to clean up your code!
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message