[Javascript] How to convert a number to string?
I would like to know what is the best way to convert a number to a string in Javascript?
1 Answer
3 years ago by Jahaan
Below are few of the ways to convert a number to string in Javascript
- inbuilt function
toString()
- '' + number
- String(number)
Speed of these methods differ based on the browser. In chrome, 2nd method seems to be fastest.
3 years ago by Meera