Get the Boolean value contained in the Boolean object using Boolean.valueOf() in JavaScript

Description

The following code shows how to get the Boolean value contained in the Boolean object using Boolean.valueOf().

Example


<!-- ww  w .  j  ava  2 s .c  o  m-->
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
bool = new Boolean(1);
document.write(bool.valueOf());
</script>
</head>
<body>
</body>
</html>

Click to view the demo

The code above generates the following result.

Get the Boolean value contained in the Boolean object using Boolean.valueOf() in JavaScript