Converting Numbers to Strings in Javascript


Numbers can be converted to strings implicitly or explicitly.

Source Code

let num = 123;
console.log(num.toString()); // "123"
console.log(String(num)); // "123"
console.log(num + ""); // "123"
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments