This is an alternative way to deliver a string version of a number value. In this case, it is formatted as a Number literal and can then be used in an eval() function to assign another number.
If you run the example below, it should yield this as a result:
(new Number(1000))
The result of calling this method is a string version of the number formatted as a Number literal.
// Create a number and then examine its source myNumber = new Number(1000); document.write(myNumber.toSource());
Prev | Home | Next |
Number.toPrecision() | Up | Number.toString() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |