Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

valueOf Method (Object) (JavaScript)

Returns the primitive value of the specified object.

object.valueOf( )

The required object reference is any intrinsic JavaScript object.

The valueOf method is defined differently for each intrinsic JavaScript object.

Object

Return Value

Array

Returns the array instance.

Boolean

The Boolean value.

Date

The stored time value in milliseconds since midnight, January 1, 1970 UTC.

Function

The function itself.

Number

The numeric value.

Object

The object itself. This is the default.

String

The string value.

The Math and Error objects do not have a valueOf method.

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Applies To: Array Object (JavaScript)| Boolean Object (JavaScript)| Date Object (JavaScript)| Function Object (JavaScript)| Number Object (JavaScript)| Object Object (JavaScript)| String Object (JavaScript)

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.