Following code is the best way to convert number to string in JS
const method1 = (value) => String(value);
const method2 = (value) => value.toString();
const method3 = (value) => value + '';
console.log(method1(10));
console.log(method2(10));
console.log(method3(10));
Top comments (2)
I will add a couple more:
thank you