CodeNewbie Community

loading...

How do you convert a number to a string in JavaScript?

malcominthemiddleware profile image Malcolm ・1 min read

Hey all! I'm new to CodeNewbie but excited to be here! I'm a Python dev learning JavaScript in my spare time and was wondering how you convert a number to a string in JavaScript?

I'm sure there's a simple solution I'm missing, but any help would be appreciated!

Discussion (4)

Collapse
krittiyaclark profile image
Krittiya Clark

Simple as

num.toString();

Collapse
malcominthemiddleware profile image
Malcolm Author

Sweet, thanks!

Collapse
pcarn9 profile image
Peter Carnesciali

String(x) should do it!

Collapse
malcominthemiddleware profile image
Malcolm Author

Appreciate the help!

Forem Open with the Forem app