The initial value of the String.prototype.constructor is the built-in String constructor.
You can use this as one way of creating strings although it is more popular to use the new String() technique.
This property is useful if you have an object that you want to clone but you don't know what sort of object it is. Simply access the constructor belonging to the object you have a reference to.
Netscape Navigator provides constructors for many objects, virtually all of them in fact, even when it is highly inappropriate to do so. MSIE is far more selective and there are some occasions when you might wish for a constructor that MSIE does not make available.
See also: | String.fromCharCode(), String.prototype |
Prev | Home | Next |
String.concat() | Up | String.fixed() |
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. |