Mega Code Archive

 
Categories / JavaScript Tutorial / Number Data Type
 

Boolean toString()

Syntax boolean.toString() The toString() method returns the string representation ("true" or "false") of the primitive Boolean value. If true, the string "true" is returned. If false, the string "false" is returned. <html>     <script language="JavaScript">     <!--     boolObj = new Boolean(false);     if(boolObj.toString() == "false")       alert("EQUAL");     else       alert("NOT Equal");     -->     </script> </html>