Number.toString()

JavaScript 1.1+, ECMAScript 1.0+, JScript 1.0+ Nav3+, NES2+, IE 3+, Opera3+ Syntax

							number.toString()

Description

The toString() method of the Number object is used to get a string representation of the Number object.

Example

Listing 6.189 shows how the toString() method is used.

Listing 6.189 Example of toString() Method
<html>
<body>

<script language="JavaScript">
<!–– Hide
var aNum = Number(21);
document.write("The string value for 21 is: " + "<b>" + aNum.toString() +
"</b>");
// End Hide ––>
</script>

</body>
</html>
							
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.