Create Boolean Object from boolean literal in JavaScript

Description

The following code shows how to create Boolean Object from boolean literal.

Example


<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var booleanObject = new Boolean(true);<!--   w  ww.j  a  v  a 2 s .  c o m-->
document.writeln(booleanObject);//object
</script>
</head>
<body>
</body>
</html>

Click to view the demo

The code above generates the following result.

Create Boolean Object from boolean literal in JavaScript