Create boolean from object in JavaScript

Description

The following code shows how to create boolean from object.

Example


<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var b6 = Boolean(new Object());    //true -- object
document.writeln(b6);
<!--from   ww  w  . java2 s . co m-->
</script>
</head>
<body>
</body>
</html>

Click to view the demo

The code above generates the following result.

Create boolean from object in JavaScript