Javascript boolean valueOf() method returns the primitive value of the specified boolean object.
Its syntax is as follows −
boolean.valueOf()
Returns the primitive value of the specified boolean object.
Try the following example.
<html> <head> <title>JavaScript valueOf() Method</title> </head> <body> <script type="text/javascript"> var flag = new Boolean(false); document.write( "flag.valueOf is : " + flag.valueOf() ); </script> </body> </html>
flag.valueOf is : false