This is an alternative way to deliver a string primitive version of a String object's value. In this case, it is formatted as a string literal and can then be used in an eval() function to assign another string.
If you run the example below, it should yield this as a result:
(new String("ABCDEF"))
The result of calling this method is a string version of the String object formatted as a string literal.
// Create a number and then examine its source myString = new String("ABCDEF"); document.write(myString.toSource());
Prev | Home | Next |
String.toLowerCase() | Up | String.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. |