<html>
<body>
<h2>JavaScript</h2>
<p>If you want to test if an object is not null, you must test if it not undefined first.</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = typeof myObj !== "undefined" && myObj !== null;
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_mistakes_object_null by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:39:35 GMT -->
</html>