DefaultValue() (Function/internal)

Internal private function.


ECMAScript edition - 2

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


ECMA 262 edition 2 - section -

ECMA 262 edition 3 - section -