August 30, 2022 04:25 pm GMT
Original Link: https://dev.to/urstrulyvishwak/javascript-different-ways-to-convert-numbers-into-alphabets-420j
Javascript: Different ways to convert numbers into alphabets
Expectation: 1 -> a, 2 -> b, 3 -> c etc.
(5 + 9).toString(36); -> e
String.fromCharCode(5 + 'A'.charCodeAt()); -> e
In both, replace 5 with other number from 1 - 26. You will get corresponding alphabet.
Always, welcome any new approaches.
You can follow me here: https://twitter.com/urstrulyvishwak
Thanks.
Original Link: https://dev.to/urstrulyvishwak/javascript-different-ways-to-convert-numbers-into-alphabets-420j
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To