| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | f1_keywords | dev_langs | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
valueOf Method (Object) (JavaScript) | Microsoft Docs |
01/18/2017 |
windows-client-threshold |
|
language-reference |
|
|
|
c555e38b-f451-4341-8fcd-4c8b02906a2c |
10 |
mikejo5000 |
mikejo |
ghogen |
Returns the primitive value of the specified object.
object.valueOf( )
The required object reference is any intrinsic [!INCLUDEjavascript] object.
The valueOf method is defined differently for each intrinsic [!INCLUDEjavascript] 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.
[!INCLUDEjsv2]
Applies To: Array Object| Boolean Object| Date Object| Function Object| Number Object| Object Object| String Object