<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript undefined</title>
</head>
<body>
<pre> <!-- Use pre element for work document.writeln() method -->
<script type="text/javascript">
var str; // Identify as undefined value.
document.writeln("str == null : ", str == null);
document.writeln("undefined == null : ", undefined == null);
var bool = Boolean(str);
document.writeln("bool : ", bool); // Boolean context Returns false
</script>
</pre>
</body>
</html>