The .toString()
method converts a number to a string.
Syntax
num.toString();
Example
Converting number to a string:
const x = 5;
console.log(x.toString());
To verify if it is a string:
const x = 5;
console.log(typeof x.toString());
Codebyte Example
Code Output