This internal function returns the default value for the object, given that the caller indicates a preferred result type in the hint argument.
The hint gives some suggestion to the receiving object about the preferred result type. This is a fairly ambiguous result. Generally if you ask for a string you will get a string. Asking for a number will generally yield a number. However, there are cases where the DefaultValue for an object cannot be rendered into the preferred type and you may generate a run-time error.
If you don't specify any hint value at all, the DefaultValue will first assume you want a Number unless the receiver is a Date object in which case it assumes a String is required.
See also: | Internal Method |
Prev | Home | Next |
defaultStatus | Up | Defensive coding |
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. |