Anjan Dutta

Convert number to string in javascript

Convert number to string in javascript

Updated On: 02/10/2021

To convert a number to a string in javascript, we can use the toString() method. We can call the toString() method on the variable directly and it doesn't take any parameter.

See the below code.

var num = 8;
var str = num.toString();
console.log(str);
// > "8"