CodeNewbie Community 🌱

Malcolm
Malcolm

Posted on

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

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!

Top comments (4)

Collapse
 
krittiyaclark profile image
Krittiya Clark

Simple as

num.toString();

Collapse
 
malcominthemiddleware profile image
Malcolm

Sweet, thanks!

Collapse
 
pcarn9 profile image
Peter Carnesciali

String(x) should do it!

Collapse
 
malcominthemiddleware profile image
Malcolm

Appreciate the help!