Anjan Dutta

Convert number to string in javascript

Convert number to string in javascript

To convert a number to a string in javascript, we can use the toString() method.

The below code explains how to do the conversion.

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