like this:

var foo = 45;
var bar = '' + foo;

Actually, even though I typically do it like this for simple convenience, over 1,000s of iterations it appears for raw speed there is an advantage for .toString()

See Performance tests here (not by me, but found when I went to write my own): http://jsben.ch/#/ghQYR

Fastest based on the JSPerf test above: str = num.toString();

It should be noted that the difference in speed is not overly significant when you consider that it can do the conversion any way 1 Million times in 0.1 seconds.

Update: The speed seems to differ greatly by browser. In Chrome num + '' seems to be fastest based on this test http://jsben.ch/#/ghQYR

Update 2: Again based on my test above it should be noted that Firefox 20.0.1 executes the .toString() about 100 times slower than the '' + num sample.

Answer from scunliffe on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_tostring_number.asp
JavaScript Number toString() Method
The toString() returns a number as a string. Every JavaScript object has a toString() method. The toString() method is used by JavaScript when an object needs to be displayed as a text (like in HTML), or when an object needs to be used as a string.
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_type_conversion.asp
JavaScript Type Conversions
In the chapter Date Methods, you will find more methods that can be used to convert dates to strings: The global method Number() can also convert booleans to numbers.
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ tryit.asp
JavaScript Number Methods
The W3Schools online code editor allows you to edit code and view the result in your browser
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_parseint.asp
JavaScript parseInt() Method
The parseInt method parses a value as a string and returns the first integer. A radix parameter specifies the number system to use: 2 = binary, 8 = octal, 10 = decimal, 16 = hexadecimal. If radix is omitted, JavaScript assumes radix 10.
๐ŸŒ
Mozilla
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Guide โ€บ Numbers_and_strings
Numbers and strings - JavaScript | MDN
This chapter introduces the two most fundamental data types in JavaScript: numbers and strings. We will introduce their underlying representations, and functions used to work with and perform calculations on them.
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_number.asp
JavaScript Number() Method
For strings, Number() returns a number or NaN. ... Number() is an ECMAScript1 (JavaScript 1997) feature. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com
Find elsewhere
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_operators.asp
JavaScript Operators
If you add a number and a string, the result will be a string! Assignment operators assign values to JavaScript variables.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ javascript-number-to-string-how-to-use-tostring-to-convert-an-int-into-a-string
JavaScript Number to String โ€“ How to Use toString to Convert an Int into a String
March 22, 2021 - The toString() method is a built-in method of the JavaScript Number object that allows you to convert any number type value into its string type representation. How to Use the toString Method in JavaScript To use the toString() method, you simply ...
๐ŸŒ
Flexiple
flexiple.com โ€บ javascript โ€บ convert-int-to-string
JavaScript Number to String โ€“ How to Use toString to Convert an Int into a String - Flexiple
Learn how to convert integers to strings in JavaScript using the toString() method with examples and easy-to-follow steps. Perfect for beginners!
๐ŸŒ
DEV Community
dev.to โ€บ sanchithasr โ€บ 7-ways-to-convert-a-string-to-number-in-javascript-4l
7 ways to convert a String to Number in JavaScript - DEV Community
May 15, 2024 - In the first paragraph "If you parse the decimal number, it will be rounded off to the nearest integer value and that value is converted to string. " I think it should say "that value is converted to a number". ... You should always pass the base as second argument to parseInt. ... Funniest Blog That Make You Fit ! ... This is a really helpful article! As a beginner in JavaScript, I often find myself struggling with converting strings to numbers.
๐ŸŒ
BitDegree
bitdegree.org โ€บ learn โ€บ javascript-number-to-string
Guide of JavaScript Number to String: Master toString
August 10, 2017 - Tutorial on JavaScript number to string. Learn to convert int to string with JavaScript. Practice JavaScript number to string here with examples.
๐ŸŒ
DEV Community
dev.to โ€บ kiani0x01 โ€บ how-to-convert-javascript-number-to-string-5dad
How to Convert JavaScript Number to String - DEV Community
July 6, 2025 - A quick and dirty way to convert a number is by adding an empty string + ''. JavaScript will coerce the number into a string, and you get your result in one short line.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Number
Number - JavaScript | MDN
Many built-in operations that expect ... The operation can be summarized as follows: Numbers are returned as-is. ... Strings are converted by parsing them as if they contain a number literal....
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_string_methods.asp
JavaScript String Methods
If the separator is omitted, the ... whole string in index [0]. If the separator is "", the returned array will be an array of single characters: ... For a complete reference to all JavaScript properties and methods, with full descriptions and many examples, go to: W3Schools' Full JavaScript ...
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ javascript โ€บ standard-library โ€บ Number โ€บ toString
JavaScript Number toString() - Convert to String | Vultr Docs
September 27, 2024 - In this article, you will learn how numbers are converted to strings and effectively employ the toString() method across various contexts. Enable JavaScript numbers to be transformed into strings easily and discover how to specify different ...
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_numbers.asp
JavaScript Numbers
If you add a string and a number, the result will be a string concatenation: let x = "10"; let y = 20; let z = x + y; Try it Yourself ยป ยท A common mistake is to expect this result to be 30: let x = 10; let y = 20; let z = "The result is: " + x + y; Try it Yourself ยป ยท A common mistake is to expect this result to be 102030: let x = 10; let y = 20; let z = "30"; let result = x + y + z; Try it Yourself ยป ยท The JavaScript interpreter works from left to right.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ convert-a-number-to-a-string-in-javascript
Convert a Number to a String in JavaScript - GeeksforGeeks
July 23, 2025 - The String() constructor accepts an integer or floating-point number as a parameter and converts it into string type.