Number.toSource()

JavaScript 1.3+, ECMAScript 1.0+ Nav4.06+ Syntax

							number.toSource()

Description

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

Example

Listing 6.188 shows how the toSource() method is used.

Listing 6.188 Example of toSource() Method
<html>
<body>

<script language="JavaScript">
<!–– Hide
// creates a new number object and then gets the string
// representation of that object.
var aNum = Number(21);
document.write(aNum.toSource());
// 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.