Create boolean from null in JavaScript

Description

The following code shows how to create boolean from null.

Example


<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var b4 = Boolean(null);            //false -- null
document.writeln(b4);
<!--   ww  w.ja va 2s  .  c o m-->
</script>
</head>
<body>
</body>
</html>

Click to view the demo

The code above generates the following result.

Create boolean from null in JavaScript