Empty Values

An empty value has nothing to do with undefined. An empty string variable has both a value and a type.

  var car = "";  <=== The value is "", the typeof is string

HTML file: Displayed by browser:
<body>
<p id="demo"></p>
<script>
   var car = "";
   document.getElementById("demo").innerHTML
   = "The value is: " +
   car + "<br />" +
   "The type is:" + typeof car;
</script>
</body>


BackTable of ContentsNext